Skip to content

Commit

Permalink
build: convert all bash scripts to shell scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Rong Sen Ng (motss) <wes.ngrongsen@gmail.com>
  • Loading branch information
motss committed Mar 8, 2022
1 parent 0410aef commit a317814
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 32 deletions.
28 changes: 0 additions & 28 deletions list-npx-cache.bash

This file was deleted.

32 changes: 32 additions & 0 deletions list-npx-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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
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')

printf '[INFO] Listing all files in the npx cache...\n'
for a in $FILES
do
printf "::group::%s\n" "$a"
cat "$a"
printf "::endgroup::\n"
done
else
printf '[INFO] npx cache not found!\n'
fi

# NOTE: List all files with human readable size in the npm cache

# NPM_CACHE_DIR="$(npm config get cache)"

# if [ -d "$NPM_CACHE_DIR" ]; then
# FILES=$(ls -lhR "$NPM_CACHE_DIR")

# printf "::group::%s\n" "$FILES"
# printf "::endgroup::"
# fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"build": "npm run clean && tsc",
"clean": "rm -rf .*cache *.log .swc/ coverage/ dist/ logs/",
"dev": "npm run serve & npm run watch",
"postinstall": "bash postinstall.bash",
"postinstall": "sh postinstall.sh",
"lint": "eslint src --ext .js,.ts",
"lint-commit": "npm x -y -- commitlint@latest --edit",
"lint:build": "npm run lint -- --config .build.eslintrc.json",
Expand Down
3 changes: 0 additions & 3 deletions postinstall.bash

This file was deleted.

3 changes: 3 additions & 0 deletions postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

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

0 comments on commit a317814

Please sign in to comment.