Skip to content

Improve bash script error handling and portability#836

Merged
hogashi merged 3 commits intonpmscriptjqfrom
copilot/sub-pr-835
Feb 17, 2026
Merged

Improve bash script error handling and portability#836
hogashi merged 3 commits intonpmscriptjqfrom
copilot/sub-pr-835

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

The bash scripts created in this PR lacked proper error handling and used non-portable shebangs. Scripts would fail silently or with cryptic errors when dependencies were missing or files didn't exist.

Changes

Error handling:

  • Added set -euo pipefail to all scripts
  • Added validation for required tools (jq, zip)
  • Added validation for required files/directories before operations

Portability:

  • Changed shebang from #!/usr/bin/bash to #!/usr/bin/env bash
  • Fixed unset variable handling with ${1:-} pattern
  • Made scripts executable with proper permissions

Code quality:

  • Fixed shellcheck warnings (read -r instead of read)
  • Added *.zip to .gitignore to exclude build artifacts

All scripts now fail fast with clear error messages when preconditions aren't met.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…angs

Co-authored-by: hogashi <12870472+hogashi@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert npm script to bash script Improve bash script error handling and portability Feb 17, 2026
Copilot AI requested a review from hogashi February 17, 2026 08:52
@hogashi hogashi marked this pull request as ready for review February 17, 2026 09:04
@hogashi hogashi merged commit ce44908 into npmscriptjq Feb 17, 2026
1 check passed
@hogashi hogashi deleted the copilot/sub-pr-835 branch February 17, 2026 09:04
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

Successfully merging this pull request may close these issues.

2 participants