cbaenziger commented on a change in pull request #32: RATIS-667 Provide a
visual for the LogService lifecycle
URL: https://github.com/apache/incubator-ratis/pull/32#discussion_r319185465
##########
File path: build.sh
##########
@@ -52,16 +60,15 @@ else
echo "RAT check appears to have passed"
fi
-if [[ $# -ne 1 ]]; then
- echo "Usage: ./build.sh <website_output>"
- exit 3
-fi
+# The command call will fail, but that's OK because we're catching it.
+set +e
+# Build the website
BUILD_OUTPUT_DIR="$1"
-HUGO_EXEC=$(which hugo)
+HUGO_EXEC="$(command -v hugo)"
if [ "$?" -ne 0 ]; then
- echo "Please install hugo and put it to the path"
- exit 1
+ echo "Please install hugo and put it to the path"
+ exit 1
fi
echo -e "\nBuilding website to ${BUILD_OUTPUT_DIR}"
-$HUGO_EXEC -d ${BUILD_OUTPUT_DIR}
+"$HUGO_EXEC" -d ${BUILD_OUTPUT_DIR}
Review comment:
Quote build directory in case it has a space?
```
cbaenzig@R90V96XH:~$ export foo="/tmp/foo bar"
cbaenzig@R90V96XH:~$ /tmp/t.sh ${foo}
2
cbaenzig@R90V96XH:~$ /tmp/t.sh "${foo}"
1
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services