-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ee6db2
commit 53e9617
Showing
2 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/bash | ||
|
||
# this function installs python3 | ||
function install_python { | ||
sudo apt-get update | ||
sudo apt-get install python3.6 | ||
python3 --version | ||
echo "Python3 is now installed on your system." | ||
} | ||
|
||
# this function installs pip3 | ||
function install_pip { | ||
sudo apt-get update | ||
sudo apt install python3-pip | ||
pip3 --version | ||
echo "Pip3 is now installed on your system." | ||
} | ||
|
||
# this function installs virtualenv | ||
function install_venv { | ||
sudo apt-get update | ||
pip3 install virtualenv | ||
pip3 freeze | grep virtualenv | ||
echo "Virualenv is now installed on your python3." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,30 @@ | ||
#!/usr/bin/bash | ||
|
||
|
||
# this function installs python3 | ||
function install_python { | ||
sudo apt-get update | ||
sudo apt-get install python3.6 | ||
python3 --version | ||
echo "Python3 is now installed on your system." | ||
} | ||
|
||
# this function installs pip3 | ||
function install_pip { | ||
sudo apt-get update | ||
sudo apt install python3-pip | ||
pip3 --version | ||
echo "Pip3 is now installed on your system." | ||
} | ||
|
||
# this function installs virtualenv | ||
function install_venv { | ||
sudo apt-get update | ||
pip3 install virtualenv | ||
pip3 freeze | grep virtualenv | ||
echo "Virualenv is now installed on your python3." | ||
} | ||
# Load the main functions | ||
source "functions.sh" | ||
|
||
|
||
# this function checks whats needed for shell script | ||
function check_requirments { | ||
if ! [[ "$(python3 -V)" =~ "Python 3" ]]; then | ||
install_python | ||
else | ||
echo "> Python3 status : OK" | ||
fi | ||
if ! [[ "$(pip3 --version)" =~ "pip 1" ]]; then | ||
install_pip | ||
else | ||
echo "> Pip3 status : OK" | ||
fi | ||
if ! [[ "$(python3 -h venv)" =~ "usage: python3" ]]; then | ||
install_venv | ||
else | ||
echo "> Venv status : OK" | ||
fi | ||
echo "Requirements checked." | ||
} | ||
|
||
|
||
echo "Running installer ..." | ||
check_requirments | ||
echo "Exit staus : 0" |