Skip to content

Commit

Permalink
Amélioration du script d'installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Situphen authored and artragis committed Nov 9, 2019
1 parent 97733bb commit 5a4c7c2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
9 changes: 5 additions & 4 deletions scripts/dependencies/arch.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#title=Arch
#desc=Utilisation de pacman
#installcmd=pacman -Syu
#desc=Utilisation de pacman / Testé sur Arch
#updatecmd=pacman -Syu --noconfirm
#installcmd=pacman -S --noconfirm
git
wget
curl
unzip
realpath
coreutils
python
python-setuptools
python-sqlparse
python3-pip
python-pip
libxml2
python-lxml
libxslt
Expand Down
3 changes: 2 additions & 1 deletion scripts/dependencies/debian.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#title=Debian
#desc=Utilisation de apt-get / Testé sur : Debian Stretch (9) et Debian Buster (10).
#desc=Utilisation de apt-get / Testé sur Debian Stretch (9), Buster (10)
#updatecmd=apt-get -y update
#installcmd=apt-get -y install
git
wget
Expand Down
4 changes: 2 additions & 2 deletions scripts/dependencies/fedora.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#title=Fedora
#desc=Utilisation de dnf
#desc=Utilisation de dnf / Testé sur Fedora 29, 30
#installcmd=dnf -y install
git
wget
curl
unzip
realpath
coreutils
python3-devel
python3-setuptools
python3-lxml
Expand Down
5 changes: 3 additions & 2 deletions scripts/dependencies/ubuntu.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#title=Ubuntu
#desc=Utilisation de apt-get / Testé sur : Ubuntu 14.04
#desc=Utilisation de apt-get / Testé sur : Ubuntu 16.04 LTS, 18.04 LTS, 19.04 & Linux Mint 19
#updatecmd=apt-get -y update
#installcmd=apt-get -y install
git
wget
curl
unzip
realpath
coreutils
python3-dev
python3-pip
python3-venv
Expand Down
15 changes: 13 additions & 2 deletions scripts/install_zds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,21 @@ if ! $(_in "-packages" $@) && ( $(_in "+packages" $@) || $(_in "+base" $@) || $
fi
echo ""

packagingTool_update=$(grep -oP '#updatecmd=\K(.*)' "$filepath")
packagingTool_install=$(grep -oP '#installcmd=\K(.*)' "$filepath")
print_info "$filepath"
IFS=$'\n'

if [[ $packagingTool_update ]]; then
print_info "sudo $packagingTool_update"
echo ""
eval "sudo $packagingTool_update"; exVal=$?
echo ""
if [[ $exVal != 0 ]]; then
print_error "!! We were unable to update packages list."
fi
fi

for dep in $(cat "$filepath"); do
if [[ $dep == "#"* ]]; then
continue;
Expand Down Expand Up @@ -154,7 +165,7 @@ if ! $(_in "-virtualenv" $@) && ( $(_in "+virtualenv" $@) || $(_in "+base" $@)
print_info "remove $(realpath $ZDS_VENV)"
rm -r $ZDS_VENV
else
print_error "We recommanded to delete this folder, press \`y\` to delete this folder"
print_error "We recommend to delete this folder, press \`y\` to delete this folder"
echo -n "Choice : "
read -n 1
echo ""
Expand All @@ -169,7 +180,7 @@ if ! $(_in "-virtualenv" $@) && ( $(_in "+virtualenv" $@) || $(_in "+base" $@)
fi

print_info "* [+virtualenv] installing \`virtualenv 16.2.0\` with pip"
pip3 install virtualenv==16.2.0
pip3 install --user virtualenv==16.2.0

print_info "* [+virtualenv] creating virtualenv"
err=$(python3 -m venv $ZDS_VENV 3>&1 1>&2 2>&3 | sudo tee /dev/stderr)
Expand Down

0 comments on commit 5a4c7c2

Please sign in to comment.