0
0
mirror of https://github.com/tj/n.git synced 2024-11-24 19:46:56 +01:00

Add single quotes around parameters in error messages

This commit is contained in:
John Gee 2019-04-21 13:02:38 +12:00
parent 0664bc5b6f
commit 6fc267147a
2 changed files with 6 additions and 4 deletions

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- internal: improve shell script based on ShellCheck suggestions, quoting variables use etc [#187] [#465]
- put single quote marks around parameters to clarify error messages [#485]
## [3.0.2] (2019-04-07)
@ -86,6 +87,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#465]: https://github.com/tj/n/issues/465
[#466]: https://github.com/tj/n/issues/466
[#467]: https://github.com/tj/n/issues/467
[#485]: https://github.com/tj/n/issues/485
[#512]: https://github.com/tj/n/issues/512
[#516]: https://github.com/tj/n/issues/516
[#518]: https://github.com/tj/n/issues/518

8
bin/n
View File

@ -500,7 +500,7 @@ install() {
| grep -E "^$version" \
| tail -n1)"
test "$version" || abort "invalid version ${1#v}"
test "$version" || abort "invalid version '${1#v}'"
fi
local dir="${VERSIONS_DIR[$DEFAULT]}/$version"
@ -518,7 +518,7 @@ install() {
log install "${BINS[$DEFAULT]}-v$version"
local url="$(tarball_url "$version")"
is_ok "$url" || is_oss_ok "$url" || abort "invalid version $version"
is_ok "$url" || is_oss_ok "$url" || abort "invalid version '$version'"
log mkdir "$dir"
if ! mkdir -p "$dir"; then
@ -603,7 +603,7 @@ display_bin_path_for_version() {
if test -f "$bin"; then
printf "%s\n" "$bin"
else
abort "$1 is not installed"
abort "'$1' is not installed"
fi
}
@ -634,7 +634,7 @@ execute_with_version() {
if test -f "$bin"; then
exec "$bin" "$@"
else
abort "$version is not installed"
abort "'$version' is not installed"
fi
}