2 changed files with 20 additions and 17 deletions
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python3 |
||||
import getpass |
||||
import tempfile |
||||
import subprocess |
||||
|
||||
def install_pyenv(): |
||||
user = getpass.getuser() |
||||
if(user=="root"): |
||||
raise Exception("You are root - you should run this script as a normal user.") |
||||
else: |
||||
# Install pyenv |
||||
pyenvcmd = ["curl","-L","https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer","|","/bin/bash"] |
||||
subprocess.call(pyenvcmd, shell=True) |
||||
|
||||
# We don't need to add ~/.pyenv/bin to $PATH, |
||||
# it is already done. |
||||
|
||||
if __name__=="__main__": |
||||
install_pyenv() |
||||
|
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
if [ "$(id -u)" == "0" ]; then |
||||
echo "" |
||||
echo "" |
||||
echo "This script should be run as a normal user." |
||||
echo "" |
||||
echo "" |
||||
exit 1; |
||||
fi |
||||
|
||||
# Install pyenv |
||||
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash |
||||
|
||||
## This should already be in ~/.bash_profile |
||||
#echo 'export PATH="~/.pyenv/bin:$PATH"' >> ~/.bash_profile |
||||
|
Loading…
Reference in new issue