diff options
| author | 2025-08-16 16:56:45 -0500 | |
|---|---|---|
| committer | 2025-08-19 19:46:52 -0500 | |
| commit | 95049dcec8589c4e62727574fa35e16f2ab5d159 (patch) | |
| tree | a8fa8c29c347c37b3b63f8d454706d56aa9e26a1 /bin | |
| parent | Missing unquote. (diff) | |
Brief: add more pre/post steps for janet-pm
1. Adding these extra steps allows more user control of the build process
for complicated builds, including pre/post steps for build, install,
test and clean.
This also fixes #225, so that prebuild is only run before build.
2. Also removes redundant calls to build in the install hook since
Janet's core install hook calls build first as well. Having this in
spork too resulted in two calls to build when `janet-pm install`
was run.
3. Adds local assertf in `janet-pm` for older Janet
4. Fixes existing problem in `janet-pm` where hardcoded syspath at the top-level
is not honored when run as `(defn main ...`. This change adds a copy of the
hardcoded paths inside defn main in a binscript, if main exists in the input.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/janet-pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/janet-pm b/bin/janet-pm index 236ee02..4dfc40e 100755 --- a/bin/janet-pm +++ b/bin/janet-pm @@ -5,6 +5,19 @@ (import spork/pm) (import spork/pm-config) (import spork/sh) + +# Fix for janet without assertf +(compwhen (not (dyn 'assertf)) + (defmacro- assertf + "Convenience macro that combines `assert` and `string/format`." + [x fmt & args] + (def v (gensym)) + ~(do + (def ,v ,x) + (if ,v + ,v + (,errorf ,fmt ,;args))))) + # Do not import declare-cc here - keep a clean separation for faster load times (def help-text |
