Skip to content

Commit 515424f

Browse files
committed
linted and formatted bash scripts
1 parent 60d718a commit 515424f

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

mk-website.bash

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
PROJECT="datatools"
44

55
function checkApp() {
6-
APP_NAME=$(which $1)
7-
if [ "$APP_NAME" = "" ] && [ ! -f "./bin/$1" ]; then
8-
echo "Missing $APP_NAME"
9-
exit 1
10-
fi
6+
APP_NAME=$(which "$1")
7+
if [ "$APP_NAME" = "" ] && [ ! -f "./bin/$1" ]; then
8+
echo "Missing $APP_NAME"
9+
exit 1
10+
fi
1111
}
1212

1313
function softwareCheck() {
14-
for APP_NAME in $@; do
15-
checkApp $APP_NAME
16-
done
14+
for APP_NAME in "$@"; do
15+
checkApp "$APP_NAME"
16+
done
1717
}
1818

19-
function MakePage () {
20-
nav="$1"
21-
content="$2"
22-
html="$3"
23-
# Always use the latest compiled mkpage
24-
APP=$(which mkpage)
25-
if [ -f ./bin/mkpage ]; then
26-
APP="./bin/mkpage"
27-
fi
28-
29-
echo "Rendering $html"
30-
$APP \
31-
"title=text:$PROJECT -- a small collection of file and shell utilities" \
32-
"nav=$nav" \
33-
"content=$content" \
34-
"sitebuilt=text:Updated $(date)" \
35-
page.tmpl > $html
36-
git add $html
19+
function MakePage() {
20+
nav="$1"
21+
content="$2"
22+
html="$3"
23+
# Always use the latest compiled mkpage
24+
APP=$(which mkpage)
25+
if [ -f ./bin/mkpage ]; then
26+
APP="./bin/mkpage"
27+
fi
28+
29+
echo "Rendering $html"
30+
$APP \
31+
"title=text:$PROJECT -- a small collection of file and shell utilities" \
32+
"nav=$nav" \
33+
"content=$content" \
34+
"sitebuilt=text:Updated $(date)" \
35+
page.tmpl >"$html"
36+
git add "$html"
3737
}
3838

3939
echo "Checking necessary software is installed"
@@ -47,7 +47,6 @@ MakePage nav.md "markdown:$(cat LICENSE)" license.html
4747

4848
# Generate the individual command docuumentation pages
4949
for FNAME in csvcols csvjoin jsoncols jsonrange xlsx2json xlsx2csv csv2mdtable csv2xlsx; do
50-
echo "Generating $FNAME.html"
51-
MakePage nav.md "$FNAME.md" "$FNAME.html"
50+
echo "Generating $FNAME.html"
51+
MakePage nav.md "$FNAME.md" "$FNAME.html"
5252
done
53-

0 commit comments

Comments
 (0)