summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-03-30 14:11:22 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-03-30 14:11:22 +0200
commit6a040747492e55a12c308b107f7f0b9fd76d2cf8 (patch)
treec8e318d2a47c536b86fbbf17236287b36f480024
parentca42f55539c9cc1ec7c6e1366e69acccbdb19513 (diff)
downloadmullvadvpn-6a040747492e55a12c308b107f7f0b9fd76d2cf8.tar.xz
mullvadvpn-6a040747492e55a12c308b107f7f0b9fd76d2cf8.zip
Add set -u for safety
-rwxr-xr-xformat.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/format.sh b/format.sh
index e88e352fee..1d54204f3e 100755
--- a/format.sh
+++ b/format.sh
@@ -3,6 +3,8 @@
# Will make sure you have rustfmt at the version in $VERSION, then format all the source code.
# Run with --only-format as the first argument to skip checking rustfmt version.
+set -u
+
VERSION="0.7.1"
CMD="rustfmt"
INSTALL_CMD="cargo install --vers $VERSION --force $CMD"
@@ -20,7 +22,7 @@ function correct_rustfmt() {
return 0
}
-if [[ "$1" != "--only-format" ]]; then
+if [[ "${1:-""}" != "--only-format" ]]; then
if ! correct_rustfmt; then
echo "Installing $CMD $VERSION"
$INSTALL_CMD