@jterrazz/codestyle 1.1.1 → 1.1.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/codestyle.sh +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jterrazz/codestyle",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "author": "Jean-Baptiste Terrazzoni <contact@jterrazz.com>",
5
5
  "bin": {
6
6
  "codestyle": "./src/codestyle.sh"
package/src/codestyle.sh CHANGED
@@ -64,10 +64,17 @@ code_pid=""
64
64
  style_pid=""
65
65
 
66
66
  # Find the node_modules/.bin directory relative to this script
67
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
67
+ # Resolve symlinks to get the real script location
68
+ SOURCE="${BASH_SOURCE[0]}"
69
+ while [ -L "$SOURCE" ]; do
70
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
71
+ SOURCE="$(readlink "$SOURCE")"
72
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
73
+ done
74
+ SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
68
75
  # Find bin directory: installed package or development
69
- if [ -x "$SCRIPT_DIR/../../.bin/oxlint" ]; then
70
- BIN_DIR="$SCRIPT_DIR/../../.bin"
76
+ if [ -x "$SCRIPT_DIR/../../../.bin/oxlint" ]; then
77
+ BIN_DIR="$SCRIPT_DIR/../../../.bin"
71
78
  elif [ -x "$SCRIPT_DIR/../node_modules/.bin/oxlint" ]; then
72
79
  BIN_DIR="$SCRIPT_DIR/../node_modules/.bin"
73
80
  else