@pugi/cli 1.0.0-alpha.212 → 1.0.0-alpha.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin/pugi +19 -5
  2. package/models.json +1 -1
  3. package/package.json +7 -7
package/bin/pugi CHANGED
@@ -1,8 +1,22 @@
1
- echo "Error: @pugi/cli postinstall did not run — binary is missing." >&2
1
+ # PUGI_LAUNCHER_STUB
2
+ self="$0"
3
+ while [ -h "$self" ]; do
4
+ link=$(readlink "$self")
5
+ case "$link" in /*) self="$link" ;; *) self="$(dirname "$self")/$link" ;; esac
6
+ done
7
+ bindir=$(cd "$(dirname "$self")" && pwd)
8
+ pkgdir=$(dirname "$bindir")
9
+ if command -v node >/dev/null 2>&1; then
10
+ node "$pkgdir/postinstall.mjs" >&2 || true
11
+ fi
12
+ if [ -x "$bindir/pugi" ] && ! grep -q "PUGI_LAUNCHER_STUB" "$bindir/pugi" 2>/dev/null; then
13
+ exec "$bindir/pugi" "$@"
14
+ fi
15
+ echo "Error: the Pugi CLI binary could not be installed." >&2
2
16
  echo "" >&2
3
- echo "This happens when --ignore-scripts was passed during install, or" >&2
4
- echo "when using a package manager that skips postinstall by default." >&2
17
+ echo "Your npm blocked the install script. Reinstall with it allowed:" >&2
18
+ echo " npm install -g @pugi/cli --allow-scripts=@pugi/cli" >&2
5
19
  echo "" >&2
6
- echo "Fix: cd node_modules/@pugi/cli && node postinstall.mjs" >&2
7
- echo "Or reinstall without --ignore-scripts." >&2
20
+ echo "Or run the install step by hand:" >&2
21
+ echo " cd "$pkgdir" && node postinstall.mjs" >&2
8
22
  exit 1