mirror of
https://github.com/janet-lang/janet
synced 2024-12-24 07:20:27 +00:00
Pick default bundle name better.
This commit is contained in:
parent
750b448f75
commit
e88042b2fa
@ -4191,7 +4191,13 @@
|
|||||||
(def path (os/realpath path))
|
(def path (os/realpath path))
|
||||||
(def clean (get config :clean))
|
(def clean (get config :clean))
|
||||||
(def check (get config :check))
|
(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 (next bundle-name) "cannot use empty bundle-name")
|
||||||
(assert (not (fexists (get-manifest-filename bundle-name)))
|
(assert (not (fexists (get-manifest-filename bundle-name)))
|
||||||
"bundle is already installed")
|
"bundle is already installed")
|
||||||
|
Loading…
Reference in New Issue
Block a user