1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-19 15:14:48 +00:00

Better shim for scripts on windows.

Arguments should be passed in properly.
This commit is contained in:
Calvin Rose 2019-08-25 17:16:44 -04:00
parent 4aa6afbf47
commit c45bad9437

View File

@ -689,7 +689,8 @@ int main(int argc, const char **argv) {
# Create a dud batch file when on windows.
(when is-win
(def name (last (string/split sep main)))
(def bat (string "@echo off\r\njanet %~dp0\\" name "%*"))
(def fullname (string binpath sep name))
(def bat (string "@echo off\r\njanet " fullname " %*"))
(def newname (string binpath sep name ".bat"))
(array/push (dyn :installed-files) newname)
(add-body "install"