Skip to content
/ janet Public
forked from janet-lang/janet

Commit

Permalink
Require opt-in behavior per script.
Browse files Browse the repository at this point in the history
This means a binscript needs to indicate that it is a Janet script, and
then the user who is installing the script can choose whether or not to
do the magic shebang replacement.
  • Loading branch information
bakpakin committed Mar 12, 2021
1 parent 0d42506 commit 9eb4c59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jpm
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,9 @@ int main(int argc, const char **argv) {
such that it will run correctly even when JANET_PATH is changed. if auto-shebang
is truthy, will also automatically insert a correct shebang line.
``
[&keys {:main main :hardcode-syspath hardcode :auto-shebang auto-shebang}]
[&keys {:main main :hardcode-syspath hardcode :is-janet is-janet}]
(def binpath (dyn :binpath JANET_BINPATH))
(def auto-shebang (or auto-shebang (dyn :auto-shebang)))
(def auto-shebang (and is-janet (dyn :auto-shebang)))
(if (or auto-shebang hardcode)
(let [syspath (dyn :modpath JANET_MODPATH)]
(def parts (peg/match path-splitter main))
Expand Down

0 comments on commit 9eb4c59

Please sign in to comment.