@agfpd/iapeer 0.2.3 → 0.2.4
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.
- package/bin/iapeer +12 -1
- package/package.json +1 -1
package/bin/iapeer
CHANGED
|
@@ -9,7 +9,18 @@
|
|
|
9
9
|
# to the CLI (`npx @agfpd/iapeer onboard`, `… create <p>`, …).
|
|
10
10
|
set -euo pipefail
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
# Resolve the real path of this script BEFORE computing the package root. npm/npx
|
|
13
|
+
# expose the bin as a SYMLINK at node_modules/.bin/iapeer → ../@agfpd/iapeer/bin/iapeer;
|
|
14
|
+
# without resolving it, dirname/.. lands on node_modules (not the package dir) and
|
|
15
|
+
# "$PKG_ROOT/src/cli/index.ts" points at node_modules/src/... → "Module not found".
|
|
16
|
+
# Walk the symlink chain so PKG_ROOT is always the actual package directory.
|
|
17
|
+
SOURCE="${BASH_SOURCE[0]}"
|
|
18
|
+
while [ -L "$SOURCE" ]; do
|
|
19
|
+
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
20
|
+
SOURCE="$(readlink "$SOURCE")"
|
|
21
|
+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
|
|
22
|
+
done
|
|
23
|
+
PKG_ROOT="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
|
|
13
24
|
CLI="$PKG_ROOT/src/cli/index.ts"
|
|
14
25
|
|
|
15
26
|
if ! command -v bun >/dev/null 2>&1; then
|