1
0
mirror of https://github.com/foxlet/macOS-Simple-KVM.git synced 2024-06-02 06:03:31 +02:00

FIX: removed/encapsulated sudo to improve convenience

- replaced pip sudo with --user option
- made easy_install pip with sudo optional by checking if the pip command exists
- added comments
This commit is contained in:
Legodev 2019-06-04 20:07:20 +02:00
parent 97f543dc45
commit c9b93a3947

View File

@ -1,7 +1,27 @@
set +x;
SCRIPTDIR="$(dirname "$0")";
cd $SCRIPTDIR
sudo easy_install pip
sudo -H pip install -r requirements.txt
echo -ne "\e[1mchecking of pip is installed... \e[0m"
# only try to install pip if it does not exist
if ! hash pip 2>/dev/null; then
echo ""
read -p "Do you want me to install pip as root? " yn
case $yn in
[Yy]* ) sudo easy_install pip;;
* ) echo -e "\e[1mplease install pip and try again\e[0m"; exit;;
esac
else
echo -e "\e[1m[OK]\e[0m"
fi
echo -e "\e[1mchecking/installing dependencies... \e[0m"
# pip should now exist, only install packages to user home
pip install -r requirements.txt --user
echo -e "\e[1mfechting macOS... \e[0m"
# now that all requirements should be fulfilled, start downloading the image
python fetch-macos.py -p 041-71284 -c DeveloperSeed
echo -e "\e[1mdone\e[0m"
exit;