diff options
author | Rasmus Andersson <rasmus@figma.com> | 2019-02-25 20:17:53 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@figma.com> | 2019-02-25 20:17:53 +0300 |
commit | ab4715013a26a1185b31a1793395f37b52632c11 (patch) | |
tree | f6908fcc130d7c9bd2c506c22fe96dde0c5a2f64 /docs/_scripts/optimize-resources.sh | |
parent | 9642bef395bb02481c0dc17493a0e6f6f6a1b1b5 (diff) | |
download | inter-ab4715013a26a1185b31a1793395f37b52632c11.tar.xz |
website
Diffstat (limited to 'docs/_scripts/optimize-resources.sh')
-rwxr-xr-x | docs/_scripts/optimize-resources.sh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/_scripts/optimize-resources.sh b/docs/_scripts/optimize-resources.sh index 68f55324a..2ff2e4e27 100755 --- a/docs/_scripts/optimize-resources.sh +++ b/docs/_scripts/optimize-resources.sh @@ -2,18 +2,26 @@ set -e cd "$(dirname "$0")/.." +MISSING_UTILS=() if ! (which svgo >/dev/null); then - echo 'svgo not found in $PATH (try `brew install svgo` on mac)' >&2 - exit 1 + echo 'svgo not found in $PATH' >&2 + MISSING_UTILS+=( svgo ) fi if ! (which pngcrush >/dev/null); then - echo 'pngcrush not found in $PATH (try `brew install pngcrush` on mac)' >&2 - exit 1 + echo 'pngcrush not found in $PATH' >&2 + MISSING_UTILS+=( pngcrush ) fi if ! (which convert >/dev/null); then - echo 'convert not found in $PATH (try `brew install imagemagick` on mac)' >&2 + echo 'convert not found in $PATH' >&2 + MISSING_UTILS+=( imagemagick ) +fi + +if ! [ -z $MISSING_UTILS ]; then + if [[ "$(uname)" = *Darwin* ]]; then + echo 'try `brew install '"${MISSING_UTILS[@]}"'` on mac' + fi exit 1 fi |