@jterrazz/codestyle 1.1.0 → 1.1.1

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 +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jterrazz/codestyle",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "author": "Jean-Baptiste Terrazzoni <contact@jterrazz.com>",
5
5
  "bin": {
6
6
  "codestyle": "./src/codestyle.sh"
package/src/codestyle.sh CHANGED
@@ -65,7 +65,14 @@ style_pid=""
65
65
 
66
66
  # Find the node_modules/.bin directory relative to this script
67
67
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
68
- BIN_DIR="$SCRIPT_DIR/../node_modules/.bin"
68
+ # Find bin directory: installed package or development
69
+ if [ -x "$SCRIPT_DIR/../../.bin/oxlint" ]; then
70
+ BIN_DIR="$SCRIPT_DIR/../../.bin"
71
+ elif [ -x "$SCRIPT_DIR/../node_modules/.bin/oxlint" ]; then
72
+ BIN_DIR="$SCRIPT_DIR/../node_modules/.bin"
73
+ else
74
+ BIN_DIR="$(npm bin 2>/dev/null)"
75
+ fi
69
76
 
70
77
  if [ "$RUN_TYPE" = true ]; then
71
78
  "$BIN_DIR/tsgo" --noEmit "${EXTRA_ARGS[@]}" > "$tmp_dir/type.log" 2>&1 &