Skip to content

Commit

Permalink
Quote "${TFENV_ROOT}" argument in all [ -n ]
Browse files Browse the repository at this point in the history
Reference:

https://github.com/koalaman/shellcheck/wiki/SC2070

```
 [ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
      ^-----------^ SC2070: -n doesn't work with unquoted arguments. Quote or use [[ ]].
```
  • Loading branch information
PeterDaveHello authored and Zordrak committed May 27, 2020
1 parent 2e0961d commit 73850e5
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion libexec/tfenv---version
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-exec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-list
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-list-remote
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-min-required
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-resolve-version
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-use
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-version-file
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-version-name
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down

0 comments on commit 73850e5

Please sign in to comment.