Try zip if tar.gz is not available

This commit is contained in:
Bob Mottram 2016-09-28 16:19:33 +01:00
parent b8205d8871
commit 3e8830eb2a
1 changed files with 18 additions and 4 deletions

View File

@ -125,9 +125,16 @@ function upgrade_gogs {
fi fi
wget ${GOGS_BIN} wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
exit 37836 GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.zip"
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.zip ]; then
exit 37836
else
unzip linux_${CURR_ARCH}.zip
fi
else
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
fi fi
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
if [ ! -d $INSTALL_DIR/gogs ]; then if [ ! -d $INSTALL_DIR/gogs ]; then
exit 37823 exit 37823
fi fi
@ -343,9 +350,16 @@ function install_gogs {
fi fi
wget ${GOGS_BIN} wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then if [ ! -f linux_${CURR_ARCH}.tar.gz ]; then
exit 37836 GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.zip"
wget ${GOGS_BIN}
if [ ! -f linux_${CURR_ARCH}.zip ]; then
exit 37836
else
unzip linux_${CURR_ARCH}.zip
fi
else
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
fi fi
tar -xzf ${INSTALL_DIR}/linux_${CURR_ARCH}.tar.gz
if [ ! -d $INSTALL_DIR/gogs ]; then if [ ! -d $INSTALL_DIR/gogs ]; then
exit 37823 exit 37823
fi fi