GoXLR-on-Linux / goxlr-on-linux

Documentation and scripts to make the GoXLR and GoXLR Mini useful on Linux.
142 stars 8 forks source link

Propose-sh-check #22

Closed lm41 closed 3 years ago

github-actions[bot] commented 3 years ago

sh-checker report

To get the full details, please check in the job output.

shellcheck errors ``` In install.sh line 10: cd /etc/goxlr ^-----------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd /etc/goxlr || exit In install.sh line 12: cd goxlr-on-linux ^---------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd goxlr-on-linux || exit In install.sh line 14: if [ ! -z $APT_GET_CMD ]; then ^-- SC2236: Use -n instead of ! -z. ^----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: if [ ! -z "$APT_GET_CMD" ]; then In install.sh line 15: cd $HOME ^------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^---^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: cd "$HOME" || exit In install.sh line 18: sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >> ".profile" ^-- SC2024: sudo doesn't affect redirects. Use .. | sudo tee -a file In install.sh line 20: sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >> ".profile" ^-- SC2024: sudo doesn't affect redirects. Use .. | sudo tee -a file In install.sh line 23: elif [ ! -z $PACMAN_CMD ]; then ^-- SC2236: Use -n instead of ! -z. ^---------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: elif [ ! -z "$PACMAN_CMD" ]; then In install.sh line 25: cd $HOME ^------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^---^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: cd "$HOME" || exit In install.sh line 31: cd /etc/goxlr/goxlr-on-linux ^--------------------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd /etc/goxlr/goxlr-on-linux || exit In install.sh line 39: echo -n "Would you like to reboot now(y/n)? " ^-- SC2039: In POSIX sh, echo flags are undefined. In install.sh line 41: stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg # Careful playing with stty ^-----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: stty raw -echo ; answer=$(head -c 1) ; stty "$old_stty_cfg" # Careful playing with stty For more information: https://www.shellcheck.net/wiki/SC2024 -- sudo doesn't affect redirects. Us... https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, echo flags are undef... https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |... ```
shfmt erros ``` --- configure_goxlr.sh.orig +++ configure_goxlr.sh @@ -12,7 +12,6 @@ jack_control start - # Load PA Sinks pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_System client_name=GoXLR_Sink_System connect=no pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_Game client_name=GoXLR_Sink_Game connect=no @@ -24,7 +23,6 @@ pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Broadcast_Mix client_name=GoXLR_Source_Broadcast_Mix connect=no pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Chat client_name=GoXLR_Source_Chat connect=no - ### Setup default connections # System Output @@ -60,4 +58,3 @@ # default-sample-rate = 48000 # realtime-scheduling = yes # exit-idle-time = -1 - --- configure_goxlr_mini.sh.orig +++ configure_goxlr_mini.sh @@ -12,7 +12,6 @@ jack_control start - # Load PA Sinks pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_System client_name=GoXLR_Sink_System connect=no pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_Game client_name=GoXLR_Sink_Game connect=no @@ -24,7 +23,6 @@ pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Broadcast_Mix client_name=GoXLR_Source_Broadcast_Mix connect=no pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Chat client_name=GoXLR_Source_Chat connect=no - ### Setup default connections # System Output @@ -60,5 +58,3 @@ # default-sample-rate = 48000 # realtime-scheduling = yes # exit-idle-time = -1 - - --- install.sh.orig +++ install.sh @@ -1,6 +1,5 @@ #!/bin/sh - APT_GET_CMD=$(which apt-get) PACMAN_CMD=$(which pacman) @@ -12,33 +11,35 @@ cd goxlr-on-linux if [ ! -z $APT_GET_CMD ]; then - cd $HOME - sudo apt-get install jackd2 pulseaudio-module-jack - if [ "$1" = "MINI" ]; then - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >> ".profile" - else - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >> ".profile" - fi + cd $HOME + sudo apt-get install jackd2 pulseaudio-module-jack + if [ "$1" = "MINI" ]; then + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >>".profile" + else + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >>".profile" + fi elif [ ! -z $PACMAN_CMD ]; then - sudo pacman -S jack2 jack2-dbus pulseaudio-jack - cd $HOME - if [ "$1" = "MINI" ]; then - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" | sudo tee -a ".bash_profile" > /dev/null - else - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" | sudo tee -a ".bash_profile" > /dev/null - fi - cd /etc/goxlr/goxlr-on-linux - sudo cp audio.conf /etc/security/limits.d + sudo pacman -S jack2 jack2-dbus pulseaudio-jack + cd $HOME + if [ "$1" = "MINI" ]; then + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" | sudo tee -a ".bash_profile" >/dev/null + else + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" | sudo tee -a ".bash_profile" >/dev/null + fi + cd /etc/goxlr/goxlr-on-linux + sudo cp audio.conf /etc/security/limits.d else - echo "error can't install packages" - exit 1; + echo "error can't install packages" + exit 1 fi echo -n "Would you like to reboot now(y/n)? " old_stty_cfg=$(stty -g) -stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg # Careful playing with stty -if echo "$answer" | grep -iq "^y" ;then - sudo reboot +stty raw -echo +answer=$(head -c 1) +stty $old_stty_cfg # Careful playing with stty +if echo "$answer" | grep -iq "^y"; then + sudo reboot fi ```
github-actions[bot] commented 3 years ago

sh-checker report

To get the full details, please check in the job output.

shellcheck errors ``` In install.sh line 10: cd /etc/goxlr ^-----------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd /etc/goxlr || exit In install.sh line 12: cd goxlr-on-linux ^---------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd goxlr-on-linux || exit In install.sh line 14: if [ ! -z $APT_GET_CMD ]; then ^-- SC2236: Use -n instead of ! -z. ^----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: if [ ! -z "$APT_GET_CMD" ]; then In install.sh line 15: cd $HOME ^------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^---^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: cd "$HOME" || exit In install.sh line 18: sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >> ".profile" ^-- SC2024: sudo doesn't affect redirects. Use .. | sudo tee -a file In install.sh line 20: sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >> ".profile" ^-- SC2024: sudo doesn't affect redirects. Use .. | sudo tee -a file In install.sh line 23: elif [ ! -z $PACMAN_CMD ]; then ^-- SC2236: Use -n instead of ! -z. ^---------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: elif [ ! -z "$PACMAN_CMD" ]; then In install.sh line 25: cd $HOME ^------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. ^---^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: cd "$HOME" || exit In install.sh line 31: cd /etc/goxlr/goxlr-on-linux ^--------------------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd /etc/goxlr/goxlr-on-linux || exit In install.sh line 39: echo -n "Would you like to reboot now(y/n)? " ^-- SC2039: In POSIX sh, echo flags are undefined. In install.sh line 41: stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg # Careful playing with stty ^-----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: stty raw -echo ; answer=$(head -c 1) ; stty "$old_stty_cfg" # Careful playing with stty For more information: https://www.shellcheck.net/wiki/SC2024 -- sudo doesn't affect redirects. Us... https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, echo flags are undef... https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |... ```
shfmt erros ``` --- configure_goxlr.sh.orig +++ configure_goxlr.sh @@ -12,7 +12,6 @@ jack_control start - # Load PA Sinks pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_System client_name=GoXLR_Sink_System connect=no pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_Game client_name=GoXLR_Sink_Game connect=no @@ -24,7 +23,6 @@ pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Broadcast_Mix client_name=GoXLR_Source_Broadcast_Mix connect=no pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Chat client_name=GoXLR_Source_Chat connect=no - ### Setup default connections # System Output @@ -60,4 +58,3 @@ # default-sample-rate = 48000 # realtime-scheduling = yes # exit-idle-time = -1 - --- configure_goxlr_mini.sh.orig +++ configure_goxlr_mini.sh @@ -12,7 +12,6 @@ jack_control start - # Load PA Sinks pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_System client_name=GoXLR_Sink_System connect=no pactl load-module module-jack-sink channels=2 sink_properties=device.description=GoXLR_Game client_name=GoXLR_Sink_Game connect=no @@ -24,7 +23,6 @@ pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Broadcast_Mix client_name=GoXLR_Source_Broadcast_Mix connect=no pactl load-module module-jack-source channels=2 source_properties=device.description=GoXLR_Chat client_name=GoXLR_Source_Chat connect=no - ### Setup default connections # System Output @@ -60,5 +58,3 @@ # default-sample-rate = 48000 # realtime-scheduling = yes # exit-idle-time = -1 - - --- install.sh.orig +++ install.sh @@ -1,6 +1,5 @@ #!/bin/sh - APT_GET_CMD=$(which apt-get) PACMAN_CMD=$(which pacman) @@ -12,33 +11,35 @@ cd goxlr-on-linux if [ ! -z $APT_GET_CMD ]; then - cd $HOME - sudo apt-get install jackd2 pulseaudio-module-jack - if [ "$1" = "MINI" ]; then - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >> ".profile" - else - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >> ".profile" - fi + cd $HOME + sudo apt-get install jackd2 pulseaudio-module-jack + if [ "$1" = "MINI" ]; then + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" >>".profile" + else + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" >>".profile" + fi elif [ ! -z $PACMAN_CMD ]; then - sudo pacman -S jack2 jack2-dbus pulseaudio-jack - cd $HOME - if [ "$1" = "MINI" ]; then - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" | sudo tee -a ".bash_profile" > /dev/null - else - sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" | sudo tee -a ".bash_profile" > /dev/null - fi - cd /etc/goxlr/goxlr-on-linux - sudo cp audio.conf /etc/security/limits.d + sudo pacman -S jack2 jack2-dbus pulseaudio-jack + cd $HOME + if [ "$1" = "MINI" ]; then + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr_mini.sh" | sudo tee -a ".bash_profile" >/dev/null + else + sudo echo "source /etc/goxlr/goxlr-on-linux/configure_goxlr.sh" | sudo tee -a ".bash_profile" >/dev/null + fi + cd /etc/goxlr/goxlr-on-linux + sudo cp audio.conf /etc/security/limits.d else - echo "error can't install packages" - exit 1; + echo "error can't install packages" + exit 1 fi echo -n "Would you like to reboot now(y/n)? " old_stty_cfg=$(stty -g) -stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg # Careful playing with stty -if echo "$answer" | grep -iq "^y" ;then - sudo reboot +stty raw -echo +answer=$(head -c 1) +stty $old_stty_cfg # Careful playing with stty +if echo "$answer" | grep -iq "^y"; then + sudo reboot fi ```