instow

:)
git clone https://git.sr.ht/~ashymad/instow
Log | Files | Refs | LICENSE

commit 1ef006d8246c3304c3651bb23e7ac873df79e53f
parent d3ba5b139947d505ddeb7aa39a6dcd022d622ea1
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Tue,  2 Jun 2026 21:58:32 +0200

npm added

Diffstat:
Msrc/main.janet | 24++++++++++++++++++++++++
Msrc/tools.janet | 1+
2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/main.janet b/src/main.janet @@ -153,6 +153,7 @@ (file/file-exists? "configure.ac") (set state :conf/autoreconf) (file/file-exists? "meson.build") (set state :conf/meson) (file/file-exists? "wscript") (set state :conf/waf) + (file/file-exists? "package.json") (set state :conf/npm) (errexit "Unable to auto-detect the build system")) :conf/autoreconf @@ -192,6 +193,13 @@ (set builddir "build") (checkrun :build/make :cmake "-B" builddir "-S" "." (stropt "-DCMAKE_INSTALL_PREFIX" prefix))) + :conf/npm + (checkrun :build/npm + :npm "install" + "--cache" (path/join builddir ".npm") + "--loglevel" "verbose" + "--include-workspace-root") + :build/make (checkrun :install/make :make @@ -222,6 +230,13 @@ :build/meson (checkrun :install/meson :meson "compile" "-C" builddir) + :build/npm + (checkrun :install/npm + :npm "run" "build" + "--cache" (path/join builddir ".npm") + "--loglevel" "verbose" + "--include-workspace-root") + :build/jpm (checkrun :install/jpm :jpm "build") @@ -249,6 +264,15 @@ (checkrun :install/go :go "install" "-v") (checkrun :move :go "clean" "-modcache")) + :install/npm + (do + (set prefix "") + (checkrun :move :npm "install" + "-g" + "--install-links" + "--cache" (path/join builddir ".npm") + "--prefix" destdir)) + :install/jpm (checkrun :move :jpm diff --git a/src/tools.janet b/src/tools.janet @@ -18,6 +18,7 @@ :meson ["meson"] :waf ["./waf" "waf"] :rinstall ["rinstall"] + :npm ["npm"] :stow ["stow" "xstow"])) (defn gettool [tool]