Script readability (under 80 chars)

This commit is contained in:
Olivier DOSSMANN 2018-08-02 17:26:55 +02:00
parent 6d93d48059
commit 6dd3f7cecc

View File

@ -2,6 +2,9 @@
SCRIPT=${SCRIPTNAME:-'alpine-chroot-install'} SCRIPT=${SCRIPTNAME:-'alpine-chroot-install'}
DIR=${DIRPATH:-'/alpine'} DIR=${DIRPATH:-'/alpine'}
script_url="https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install"
script_version="v0.9.0"
script_name="alpine-chroot-install"
# Tests # Tests
if ! [[ $DIR == /* ]]; then if ! [[ $DIR == /* ]]; then
@ -10,7 +13,7 @@ fi
# DL alpine install script # DL alpine install script
if ! test -f "$SCRIPT"; then if ! test -f "$SCRIPT"; then
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install -O "$SCRIPT" \ wget "${script_url}/${script_version}/${script_name}" -O "$SCRIPT" \
&& echo "e5dfbbdc0c4b3363b99334510976c86bfa6cb251 ${SCRIPT}" | sha1sum -c \ && echo "e5dfbbdc0c4b3363b99334510976c86bfa6cb251 ${SCRIPT}" | sha1sum -c \
|| exit 1 || exit 1
chmod +x "$SCRIPT" chmod +x "$SCRIPT"
@ -18,7 +21,16 @@ fi
# Install Alpine # Install Alpine
if ! test -d "$DIR"; then if ! test -d "$DIR"; then
sudo sh ./$SCRIPT -d $DIR -p build-base -p git -p zsh -p lua-filesystem -p luarocks5.1 -p lua-toml -p moonscript -p abuild -p lua-argparse || exit 1 sudo sh ./$SCRIPT -d $DIR \
-p abuild \
-p build-base \
-p git \
-p lua-argparse \
-p lua-filesystem \
-p lua-toml \
-p luarocks5.1 \
-p moonscript \
-p zsh || exit 1
fi fi
# Set rc_sys="prefix" to not disturb systemd on current system # Set rc_sys="prefix" to not disturb systemd on current system