mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-06-05 22:07:09 +08:00
[Tests] install_nvm_from_git: fix malformed test command (missing space before ])
`[ "${head_ref}" != "${avoid_ref}"]` is missing the space before the closing bracket,
so the shell prints `[: missing ']'` and the avoid_ref assertion never actually runs
(it is inside an `if` condition, so the error was non-fatal and silently disabled the check)
This commit is contained in:
@@ -61,7 +61,7 @@ test_install_data() {
|
||||
fi
|
||||
|
||||
local head_ref="$(git for-each-ref --points-at HEAD --format='%(refname:short)' 'refs/tags/')"
|
||||
if [ -n "${avoid_ref}" ] && [ "${head_ref}" != "${avoid_ref}"]; then
|
||||
if [ -n "${avoid_ref}" ] && [ "${head_ref}" != "${avoid_ref}" ]; then
|
||||
echo "${current_ref}" | grep -q "$avoid_ref" && die "install_nvm_from_git ${message} did clone with unwanted ref ${avoid_ref}"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user