mirror of
https://github.com/openstenoproject/qmk
synced 2024-11-10 02:30:07 +00:00
Read user input properly in linux_install.sh for Gentoo (#4395)
* Change spaces to tabs on two lines The rest of the file uses tabs * Read user input in a non-terrible, non-hacky way * Remove unnecessary tee call * read -p is not POSIX * Add missing $ to echo GENTOO_WARNING * Replace non-POSIX echo -n with printf * Use cd ... || exit 1 in case git clone fails * Add missing sudo Thanks @snortwolf * Undo replacing tee with >>
This commit is contained in:
parent
b7d2a9f980
commit
0c1256e60a
1 changed files with 8 additions and 10 deletions
|
@ -70,19 +70,17 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then
|
||||||
wget \
|
wget \
|
||||||
zip
|
zip
|
||||||
git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
|
git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer
|
||||||
cd /tmp/dfu-programmer
|
cd /tmp/dfu-programmer || exit 1
|
||||||
makepkg -sic
|
makepkg -sic
|
||||||
rm -rf /tmp/dfu-programmer/
|
rm -rf /tmp/dfu-programmer/
|
||||||
|
|
||||||
elif grep ID /etc/os-release | grep -q gentoo; then
|
elif grep ID /etc/os-release | grep -q gentoo; then
|
||||||
echo GENTOO_WARNING | fmt
|
echo "$GENTOO_WARNING" | fmt
|
||||||
echo -n "Proceed (y/N)? "
|
printf "\nProceed (y/N)? "
|
||||||
old_stty_cfg=$(stty -g)
|
read -r answer
|
||||||
stty raw -echo
|
|
||||||
answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done )
|
|
||||||
stty $old_stty_cfg
|
|
||||||
if echo "$answer" | grep -iq "^y"; then
|
if echo "$answer" | grep -iq "^y"; then
|
||||||
sudo touch /etc/portage/package.use/qmkfirmware
|
sudo touch /etc/portage/package.use/qmkfirmware
|
||||||
|
# tee is used here since sudo doesn't apply to >>
|
||||||
echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
|
echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null
|
||||||
sudo emerge -auN \
|
sudo emerge -auN \
|
||||||
app-arch/unzip \
|
app-arch/unzip \
|
||||||
|
|
Loading…
Reference in a new issue