Skip to content

Commit

Permalink
fix: Make scripts more robust on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyJones committed May 20, 2022
1 parent b2a0669 commit 57430ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test-dev": "jest --runInBand --watch",
"start": "webpack --watch --display errors-only",
"lint": "eslint 'src/**' --ext .js",
"preinstall": "./scripts/create-key.sh",
"preinstall": "bash ./scripts/create-key.sh",
"prebuild-dist": "npm run lint && npm run test",
"build-dist": "npm run build",
"predeploy": "npm run build-dist",
Expand All @@ -22,7 +22,7 @@
"format:fix": "npm run format:base -- --write",
"format:check": "npm run format:base -- --check",
"release": "standard-version",
"deploy": "./scripts/deploy.sh",
"deploy": "bash ./scripts/deploy.sh",
"coverage": "jest --runInBand --coverage",
"snyk-protect": "snyk protect",
"prepare": "npm run snyk-protect"
Expand Down
6 changes: 5 additions & 1 deletion scripts/create-key.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash -eu
#!/bin/bash

set -e
set -u

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the script is running
. "$SCRIPT_DIR"/lib-robust-bash.sh # load the robust bash library
PROJECT_ROOT="$SCRIPT_DIR"/.. # Figure out where the project directory is
Expand Down
5 changes: 4 additions & 1 deletion scripts/lib-robust-bash.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash -eu
#!/bin/bash

set -e
set -u

# Check to see that we have a required binary on the path
function require_binary {
Expand Down

0 comments on commit 57430ed

Please sign in to comment.