Skip to content

Commit

Permalink
build: move bash scripts to sh (#124)
Browse files Browse the repository at this point in the history
* Change file names to .sh
* Change shebang
* Update references to files
* Use "[" operator in conditionals instead of bash-specific "[[" operator
  • Loading branch information
lorenzodalaqua authored Mar 8, 2022
1 parent 1fdd4a0 commit 9eb42ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ jobs:
- name: Install dependencies
if: env.CI_SKIP == 'false'
run: |
bash ./list-npx-cache.bash
bash ./list-npx-cache.sh
npm ci
bash ./list-npx-cache.bash
bash ./list-npx-cache.sh
- name: Lint
if: env.CI_SKIP == 'false'
Expand Down
4 changes: 2 additions & 2 deletions list-npx-cache.bash → list-npx-cache.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
#!/bin/sh

# NOTE: THere is a discrepancy in the npx cache in npm between 8.4.1 and 8.1.4.
# There is an additional zx found in the npx cache when compared to the local npx cache using 8.1.4.

NPX_CACHE_DIR="$(npm config get cache)/_npx"

if [[ -d $NPX_CACHE_DIR ]]; then
if [ -d "$NPX_CACHE_DIR" ]; then
FILES=$(find $NPX_CACHE_DIR -type f | grep -v 'node_modules' | grep -v 'package-lock.json')
# FILES=$(find $NPX_CACHE_DIR -type f | grep -v 'node_modules')

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"scripts": {
"build": "npm run clean && tsc",
"clean": "rm -rf .*cache *.log .swc/ coverage/ dist/ logs/",
"postinstall": "bash postinstall.bash",
"postinstall": "sh postinstall.sh",
"lint": "eslint src --ext .js,.ts",
"lint:build": "npm run lint -- --config .build.eslintrc.json",
"lint:commit": "npm x -y -- commitlint@latest --edit",
Expand Down
2 changes: 1 addition & 1 deletion postinstall.bash → postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh

npx -y -- zx@latest ./postinstall.mjs

0 comments on commit 9eb42ae

Please sign in to comment.