Universal git

This commit is contained in:
Eric Nemchik
2020-09-27 19:59:57 -05:00
parent f4cb91a286
commit d1464e1cde
7 changed files with 31 additions and 69 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/with-contenv bash
# Determine if setup is needed
if [[ -n "$(command -v git)" ]]; then
## Ubuntu
if [ -f /usr/bin/apt ]; then
apt-get update
apt-get install --no-install-recommends -y \
git
fi
# Alpine
if [ -f /sbin/apk ]; then
apk add --no-cache \
git
fi
# cleanup
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
fi