1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 10:30:04 +01:00
metamask-extension/development/shellcheck.sh
ricky e5682eec38
Add lint:shellcheck:package (#7568)
* Add lint:shellcheck:package

* Add double quote as per jq suggestion

* Use single quotes

* Ignore SC2016

* Use shellcheck script

* Set some flags

* Put shellcheck --version on new line

* Disable SC2016 (singe quotes is actually what we want here)
2019-12-11 15:52:08 -05:00

15 lines
368 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -u
set -x
set -o pipefail
shellcheck --version
# lint all *.sh files
find . -type f -name '*.sh' ! -path './node_modules/*' -print0 | xargs -0 shellcheck
# lint all .scripts in package.json
# shellcheck disable=SC2016
list=$(jq -r '.scripts | keys[] as $key | .[$key]' < package.json)
printf "#!/bin/bash\n%s\n" "$list" | shellcheck -