Closed dhirschfeld closed 2 years ago
Installing mambaforge requires admin permissions so we should error out early if the user doesn't have the required permissions.
mambaforge
Error:
+ filepath=/tmp/install.sh.rxaKyDlyhn6F/Mambaforge-4.12.0-2-Linux-x86_64.sh + trap cleanup EXIT + USER=sysop + chown sysop:sysop /tmp/install.sh.rxaKyDlyhn6F/Mambaforge-4.12.0-2-Linux-x86_64.sh + prefix=/opt/mambaforge + mkdir -pv /opt/mambaforge/envs mkdir: cannot create directory ‘/opt/mambaforge’: Permission denied + cleanup + rm -rf /tmp/install.sh.rxaKyDlyhn6F
sudo -n whoami can be used to test for admin permissions:
sudo -n whoami
$ sudo -n whoami sudo: a password is required $ sudo whoami [sudo] password for sysop: root $ sudo -n whoami root
...which should be added immediately after the command line parsing: https://github.com/energy-quants/bootstrap/blob/8db07162817ec13e5cd46e7f6daf629addaaab58/linux/mambaforge/install.sh#L1-L8
Installing
mambaforge
requires admin permissions so we should error out early if the user doesn't have the required permissions.Error:
sudo -n whoami
can be used to test for admin permissions:...which should be added immediately after the command line parsing: https://github.com/energy-quants/bootstrap/blob/8db07162817ec13e5cd46e7f6daf629addaaab58/linux/mambaforge/install.sh#L1-L8