0
0
mirror of https://github.com/tj/n.git synced 2024-11-24 02:27:28 +01:00

Use POSIX compatible read flags. Switch back to sh.

This commit is contained in:
John Gee 2022-12-13 22:28:38 +13:00
parent 1edded1f20
commit d5b01f5daf

6
bin/n
View File

@ -1,8 +1,7 @@
#!/usr/bin/env dash
#!/usr/bin/env sh
# shellcheck disable=SC2155,SC3043
# Disabled "Declare and assign separately to avoid masking return values": https://github.com/koalaman/shellcheck/wiki/SC2155
# Disabled "In POSIX sh, local is undefined." as widely defined and convenient: https://github.com/koalaman/shellcheck/wiki/SC3043
# WIP specify dash in shebang so do not get BASH!
#
# log <type> <msg>
@ -1421,7 +1420,8 @@ uninstall_installed() {
# This covers tarballs for at least node 4 through 10.
while true; do
read -r -p "Do you wish to delete node and npm from ${N_PREFIX}? " yn
printf "Do you wish to delete node and npm from %s? " "${N_PREFIX}"
read -r yn
case $yn in
[Yy]* ) break ;;
[Nn]* ) exit ;;