From e88042b2fa9fc79fb8b57542ed706bc0b655d7cc Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 25 May 2024 16:09:49 -0500 Subject: [PATCH] Pick default bundle name better. --- src/boot/boot.janet | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 034fe9d4..117b842b 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -4191,7 +4191,13 @@ (def path (os/realpath path)) (def clean (get config :clean)) (def check (get config :check)) - (default bundle-name (last (string/split "/" path))) + (default bundle-name + (let [sep (if (string/find "\\" path) "\\" "/")] + (last (string/split sep path)))) + (assert (not (string/check-set "\\/" bundle-name)) + (string "bundle-name " + bundle-name + " cannot contain path separators")) (assert (next bundle-name) "cannot use empty bundle-name") (assert (not (fexists (get-manifest-filename bundle-name))) "bundle is already installed")