veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.55k stars 46 forks source link

fix install script for FreeBSD, add doas priv elevation #139

Closed sakhmatd closed 1 year ago

sakhmatd commented 1 year ago

138 - fix install script for FreeBSD, add doas priv elevation

Fixes #138, adds support for doas as a sudo alternative.

Description

The warn on line 113 corrupts the sudo variable set by the script. Here is a relevant trace (using bash -x)

++ warn 'Root permissions are required to install dependecies'                                                  [567/1926]
++ printf '%s\n' '! Root permissions are required to install dependecies'
++ elevate_priv
++ has sudo
++ command -v sudo
++ sudo -v
++ unset sudo
++ sudo=sudo
++ echo sudo
+ sudo='! Root permissions are required to install dependecies
sudo'
+ '!' Root permissions are required to install dependecies sudo pkg install -y curl wget libssh gcc dbus pkgconf
install.sh: line 295: $'\E[23m!': command not found

Removing the information line fixes the issue. Seeing that similar information is provided in elevate_priv, the line is redundant and should be fine to remove.

elevate_priv was rewritten to assign the sudo variable and to add support for doas as a popular alternative to sudo.

Type of change

Please select relevant options.

Acceptance tests

veeso commented 1 year ago

Thank you! Appreciated