File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed
Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
33DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
4- HUGO_BIN=${HUGO_BIN:= " hugo" }
54
6- # check for hugo
5+ source hugo-check.sh
76
8- if ! [ -x " $( command -v $HUGO_BIN ) " ]; then
9- echo " Error: could not find Hugo (looked for '$HUGO_BIN ')" >&2
10- echo
11- echo " If Hugo is installed but the command is not named 'hugo', set HUGO_BIN to the correct command name:" >&2
12- echo
13- echo " export HUGO_BIN=\" my-hugo\" " >&2
14- echo
15- echo " If Hugo is not installed, see https://gohugo.io/getting-started/quick-start/" >&2
16- exit 1
17- fi
7+ hugoNoisyCheck || exit 1
188
199# clean and run build
2010
2111pushd $DIR > /dev/null
2212pushd ../docs/ > /dev/null
2313
14+ echo " Cleaning public/ dir."
15+ rm -rf public
16+
2417echo " Building hugo docs."
2518hugo
2619
2720echo " Building storybook."
28- mkdir public/demo
2921npm run build-storybook
22+ mkdir public/demo
3023cp -r ../.storybook_out/* public/demo
3124
3225echo " Pushing to github pages."
Original file line number Diff line number Diff line change @@ -6,4 +6,13 @@ for el in "$@"; do
66 CMD=" $CMD --scope \" */$el \" "
77done
88
9+ source scripts/hugo-check.sh
10+ if hugoCheck; then
11+ pushd docs > /dev/null
12+ hugo server &
13+ popd > /dev/null
14+ else
15+ echo " Not running Hugo server (docs site) becuase hugo is not installed."
16+ fi
17+
918eval $CMD
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ HUGO_BIN=${HUGO_BIN:= " hugo" }
4+
5+ hugoCheck () {
6+ command -v $HUGO_BIN
7+ return $?
8+ }
9+
10+ hugoNoisyCheck () {
11+ hugoCheck && return 0
12+
13+ echo " Error: could not find Hugo (looked for '$HUGO_BIN ')" >&2
14+ echo
15+ echo " If Hugo is installed but the command is not named 'hugo', set HUGO_BIN to the correct command name:" >&2
16+ echo
17+ echo " export HUGO_BIN=\" my-hugo\" " >&2
18+ echo
19+ echo " If Hugo is not installed, see https://gohugo.io/getting-started/quick-start/" >&2
20+ return 1
21+ }
You can’t perform that action at this time.
0 commit comments