Detect when URL is local and skip downloading

This commit is contained in:
Skylar Ittner 2020-12-23 00:51:28 -07:00
parent 566fcdc4f3
commit 2858490a1c

View File

@ -47,8 +47,13 @@ mkdir -p debian/usr/lib/nw.js
trap "clean_exit" 2
# Download binary
echo "Downloading and unpacking $URL"
wget -q -O- $URL | tar -xvz --strip 1 -C debian/usr/lib/nw.js
if [[ $URL == http*://* ]] ; then
echo "Downloading and unpacking $URL"
wget -q -O- $URL | tar -xvz --strip 1 -C debian/usr/lib/nw.js
else
echo "Unpacking local file $URL"
tar -xvz --strip 1 -C debian/usr/lib/nw.js -f $URL
fi
echo "Packaging deb file"
dpkg-deb -b debian "out/$FILENAME"