From 7bc21ac933fa307773f7c6d260ed3323b97bd86c Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 14 Jul 2023 10:40:10 +0200 Subject: [PATCH] nushell: Ranges are inclusive --- home-manager/modules/nushell/scripts/kink.nu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/modules/nushell/scripts/kink.nu b/home-manager/modules/nushell/scripts/kink.nu index 8ff4e08..74fd65f 100644 --- a/home-manager/modules/nushell/scripts/kink.nu +++ b/home-manager/modules/nushell/scripts/kink.nu @@ -11,7 +11,7 @@ export def main [channel?: string] { }) let playlist = ($playlist.playlist | transpose | where {|x| ($x.column0 | str starts-with "File") } | get column1) mpc clear - let streamIndex = (random integer ..($playlist | length)) + let streamIndex = (random integer ..(($playlist | length) - 1)) echo $"Playing stream ($streamIndex)" let stream = ($playlist | get $streamIndex) mpc add $stream