Skip to content

Commit

Permalink
fix: Fix bin resolution for metapackage structure
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 12, 2024
1 parent fc9a154 commit ab75994
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bin/eslint
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('eslint/package.json')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('eslint/package.json')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'eslint' not found"
Expand Down
3 changes: 2 additions & 1 deletion bin/husky
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('husky')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('husky')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'husky' not found"
Expand Down
3 changes: 2 additions & 1 deletion bin/lint-staged
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('lint-staged/package.json')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('lint-staged/package.json')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'lint-staged' not found"
Expand Down
3 changes: 2 additions & 1 deletion bin/prettier
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('prettier')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('prettier')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'prettier' not found"
Expand Down
3 changes: 2 additions & 1 deletion bin/stylelint
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('stylelint/package.json')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('stylelint/package.json')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'stylelint' not found"
Expand Down
3 changes: 2 additions & 1 deletion bin/svgo
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

BINDIR=$(dirname $(node -pe "require.resolve('svgo/package.json')"))
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('${0//\\//}')")))
BINDIR=$(dirname $(cd "$SRCDIR"; node -pe "require.resolve('svgo/package.json')"))

if [[ -z "$BINDIR" ]]; then
echo "Required package 'svgo' not found"
Expand Down

0 comments on commit ab75994

Please sign in to comment.