Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn’t work with relative script #42

Open
ai opened this issue Aug 24, 2024 · 0 comments
Open

Doesn’t work with relative script #42

ai opened this issue Aug 24, 2024 · 0 comments

Comments

@ai
Copy link
Contributor

ai commented Aug 24, 2024

Describe the bug

This config:

{
  "*.test.ts": "./scripts/tsnode ./scripts/check-focused-tests.ts",
}

throws an error:

./scripts/tsnode does not exist

but calling ./scripts/tsnode ./scripts/check-focused-tests.ts in the shell works fine.

Reproduction

mkdir test
cd test
git init
npm add nano-staged 
git add .
git commit -m 'Initial'
echo "#\!/bin/bash\necho 'Good'" > ./script
chmod a+x ./script
echo '{  "script": "./script" }' > nano-staged.json
git add .
./node_modules/.bin/nano-staged --config ./nano-staged.json

Replacing { "script": "./script" }{ "script": "bash ./script" } fixes issue.

System Info

System:
    OS: Linux 6.10 Fedora Linux 40 (Workstation Edition)
    CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon  780M Graphics
    Memory: 14.39 GB / 27.21 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - /usr/bin/node
    npm: 10.5.0 - /usr/bin/npm
  Browsers:
    Chrome: 128.0.6613.84

Used Package Manager

pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant