@brianlovin/hn-cli 0.4.15 → 0.4.17

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/hn +13 -1
  2. package/dist/cli.js +69 -69
  3. package/package.json +6 -6
package/bin/hn CHANGED
@@ -1,6 +1,18 @@
1
1
  #!/bin/sh
2
2
  # Launcher that works with both Node.js and Bun
3
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
3
+
4
+ # Resolve symlinks to find the real script location
5
+ SCRIPT="$0"
6
+ while [ -L "$SCRIPT" ]; do
7
+ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
8
+ SCRIPT="$(readlink "$SCRIPT")"
9
+ # Handle relative symlinks
10
+ case "$SCRIPT" in
11
+ /*) ;;
12
+ *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;;
13
+ esac
14
+ done
15
+ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
4
16
 
5
17
  if command -v bun >/dev/null 2>&1; then
6
18
  exec bun "$SCRIPT_DIR/hn.mjs" "$@"