From e702d64cb6a6a5597aab4ab027a017b1826ac871 Mon Sep 17 00:00:00 2001 From: Maxime Mangel Date: Sun, 31 Dec 2023 18:29:06 +0100 Subject: [PATCH] Fix build script when no additional arguments is passed for ava --- src/Glutinum.Build/Main.fs | 5 ++--- src/Glutinum.Build/Test/Specs.fs | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Glutinum.Build/Main.fs b/src/Glutinum.Build/Main.fs index 27fa693..e41dc29 100644 --- a/src/Glutinum.Build/Main.fs +++ b/src/Glutinum.Build/Main.fs @@ -15,9 +15,8 @@ Available commands: Options: --watch Watch for changes and re-run the tests - You can pass additional arguments to 'ava' - by using '--' followed by the arguments - For example: -- --match="**class**" + You can pass additional arguments to 'ava' by using '--' followed by the arguments + For example: ./build.sh test --watch -- --match="**class**" cli Build the CLI tool Options: diff --git a/src/Glutinum.Build/Test/Specs.fs b/src/Glutinum.Build/Test/Specs.fs index 48e7868..125c63c 100644 --- a/src/Glutinum.Build/Test/Specs.fs +++ b/src/Glutinum.Build/Test/Specs.fs @@ -8,10 +8,12 @@ let handle (args: string list) = let isWatch = args |> List.contains "--watch" let additionalArgs = - args - |> List.skipWhile (fun x -> x <> "--") - |> List.skip 1 - |> String.concat " " + let candidates = args |> List.skipWhile (fun x -> x <> "--") + + if List.isEmpty candidates then + "" + else + candidates |> List.skip 1 |> String.concat " " Pnpm.install ()