diff options
| author | 2025-03-20 22:21:30 -0500 | |
|---|---|---|
| committer | 2025-03-20 22:26:06 -0500 | |
| commit | d39bb41b964a8ddccead1f3ffe862ce16f17730a (patch) | |
| tree | 5657018f46158e3a136c072de74c73b535750332 /bin | |
| parent | Add support for custom module trees in janet-pm (diff) | |
Add quickbin.
Also remove extra imports from janet-pm to make it run a bit faster.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/janet-pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/janet-pm b/bin/janet-pm index e2db0d0..c48acdc 100755 --- a/bin/janet-pm +++ b/bin/janet-pm @@ -4,7 +4,7 @@ (import spork/path) (import spork/pm) (import spork/sh) -(import spork/build-rules) +# Do not import declare-cc here - keep a clean separation for faster load times (def help-text ``` @@ -67,6 +67,11 @@ relative to project.janet. Will patch the module paths to load built native code without installing it. Shorthand for `run check`. + quickbin entry output + Create an executable file from a script, statically linking in any dependencies found while compiling + the script. The script should contain a main function that will serve as the main function for the generated + executable. + save-lockfile (dest) Save all currently installed bundles to a lockfile @@ -218,6 +223,17 @@ [name] (pm/scaffold-project name {:c false :exe true})) +(defn quickbin + "Create an executable file" + [entry output] + # Lazy load + (def module + (require (if (dyn :install-time-syspath) + "@install-time-syspath/spork/declare-cc" + "spork/declare-cc"))) + (def quickbin-fn (module/value module "quickbin")) + (quickbin-fn entry output)) + (def subcommands {"build" build "clean" clean @@ -233,6 +249,7 @@ "new-exe-project" new-exe-project "load-lockfile" load-lockfile "save-lockfile" save-lockfile + "quickbin" quickbin "list-pkgs" list-pkgs "clear-cache" clear-cache "run" run |
