Update 'INSTALL_PACKAGES' structure to use '|' delimited list.

Renamed installer script to 98.
This commit is contained in:
RoboMagus
2022-02-20 19:04:49 +01:00
committed by GitHub
parent 31d95ba68a
commit ee5ec110d2
3 changed files with 31 additions and 23 deletions
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/with-contenv bash
# Exit if no installable packages are provided
if [ -z ${INSTALL_PACKAGES+x} ]; then
echo "**** No packages to install ****"
exit 0
fi
# Ubuntu
if [ -f /usr/bin/apt ]; then
apt-get install -y --no-install-recommends ${INSTALL_PACKAGES}
fi
# Alpine
if [ -f /sbin/apk ]; then
apk add --no-cache ${INSTALL_PACKAGES}
fi
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/with-contenv bash
# Exit if no installable packages are provided
if [ -z ${INSTALL_PACKAGES+x} ]; then
echo "**** No packages to install ****"
exit 0
fi
#Split list of packages on delimiter '|'
IFS='|'
INSTALL_PACKAGES=(${INSTALL_PACKAGES})
for PKG in "${INSTALL_PACKAGES[@]}"; do
echo "Installing ${PKG}"
# Ubuntu
if [ -f /usr/bin/apt ]; then
apt install -y --no-install-recommends ${PKG}
fi
# Alpine
if [ -f /sbin/apk ]; then
apk add --no-cache ${PKG}
fi
done