Support downloading tar archive, instead of git repo

This commit is contained in:
Ian Douglas Scott 2017-03-29 12:10:41 -07:00
parent c20fed785f
commit f1e261f868
No known key found for this signature in database
GPG Key ID: 4924E10E199B5959

36
cook.sh
View File

@ -48,19 +48,41 @@ function op {
op $1 unfetch
;;
fetch)
if [ ! -d build ]
if [ -z "$GIT" ]
then
git clone --recursive "$GIT" build
if [ ! -f "$(basename "$SRC")" ]
then
wget "$SRC"
fi
rm -rf build
tar xvf "$(basename "$SRC")"
mv "$DIR" build
else
if [ ! -d build ]
then
git clone --recursive "$GIT" build
fi
pushd build > /dev/null
git pull
git submodule sync
git submodule update --init --recursive
popd > /dev/null
fi
if [ -f "patch" ]
then
patch -p1 -d build < patch
fi
pushd build > /dev/null
git pull
git submodule sync
git submodule update --init --recursive
popd > /dev/null
;;
unfetch)
rm -rfv build
if [ ! -z "$SRC" ]
then
rm -f "$(basename "$SRC")"
fi
;;
version)
pushd build > /dev/null