I have script to be sure that I changed versions everywhere. If I made a mistake, this script will exit with 1 code and prints:
Update pnpm version in .github/workflows/test.yml
I add this script to nano-staged and it works well. But nano-staged has unnecessary Error block at the end of output.
Current output:
Nano Staged v0.4.1
- Preparing pipeliner...
» Done backing up original repo state.
- Running tasks...
*.(js|ts) no staged files matching the pattern were found.
*.css no staged files matching the pattern were found.
*.svelte no staged files matching the pattern were found.
.tool-versions node ./scripts/check-versions.js
- Restoring to its original state...
» Done restoring up to its original state.
- Removing patch files...
» Done removing up patch files.
node ./scripts/check-versions.js:
Update pnpm version in .github/workflows/test.yml
Error
at Object.runTasks (file:///home/ai/Dev/slowreader/node_modules/.pnpm/nano-staged@0.4.1/node_modules/nano-staged/lib/pipeliner.js:118:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.backupUnstagedFiles (file:///home/ai/Dev/slowreader/node_modules/.pnpm/nano-staged@0.4.1/node_modules/nano-staged/lib/pipeliner.js:62:7)
at async Object.run (file:///home/ai/Dev/slowreader/node_modules/.pnpm/nano-staged@0.4.1/node_modules/nano-staged/lib/pipeliner.js:42:7)
at async run (file:///home/ai/Dev/slowreader/node_modules/.pnpm/nano-staged@0.4.1/node_modules/nano-staged/lib/run.js:58:5) {
tasks: '\x1B[31mnode ./scripts/check-versions.js:\n' +
'\x1B[39mUpdate pnpm version in .github/workflows/test.yml'
}
Expected output:
Nano Staged v0.4.1
- Preparing pipeliner...
» Done backing up original repo state.
- Running tasks...
*.(js|ts) no staged files matching the pattern were found.
*.css no staged files matching the pattern were found.
*.svelte no staged files matching the pattern were found.
.tool-versions node ./scripts/check-versions.js
- Restoring to its original state...
» Done restoring up to its original state.
- Removing patch files...
» Done removing up patch files.
node ./scripts/check-versions.js:
Update pnpm version in .github/workflows/test.yml
I have script to be sure that I changed versions everywhere. If I made a mistake, this script will exit with
1
code and prints:I add this script to
nano-staged
and it works well. Butnano-staged
has unnecessaryError
block at the end of output.Current output:
Expected output: