Linux check for Linux script

These changes are mostly just to mirror the macOS packaging script.
This commit is contained in:
Benjamin Sago 2017-10-01 10:55:38 +02:00
parent d420d878c5
commit baccfe544b

View File

@ -8,6 +8,13 @@ set -e
# If youre in the VM, you can run it using the package-exa command. # If youre in the VM, you can run it using the package-exa command.
# Linux check!
uname=`uname -s`
if [[ "$uname" != "Linux" ]]; then
echo "Gotta be on Linux to run this (detected '$uname')!"
exit 1
fi
# First, we need to get the version number to figure out what to call the zip. # First, we need to get the version number to figure out what to call the zip.
# We do this by getting the first line from the Cargo.toml that matches # We do this by getting the first line from the Cargo.toml that matches
# /version/, removing its whitespace, and building a command out of it, so the # /version/, removing its whitespace, and building a command out of it, so the
@ -17,7 +24,7 @@ toml_file="/vagrant/Cargo.toml"
eval exa_$(grep version $toml_file | head -n 1 | sed "s/ //g") eval exa_$(grep version $toml_file | head -n 1 | sed "s/ //g")
if [ -z "$exa_version" ]; then if [ -z "$exa_version" ]; then
echo "Failed to parse version number! Can't build exa!" echo "Failed to parse version number! Can't build exa!"
exit exit 1
else else
echo "Building exa v$exa_version" echo "Building exa v$exa_version"
fi fi
@ -40,7 +47,7 @@ strip -v "$exa_linux_binary"
# Compress the binary for upload. The -j flag is necessary to avoid the # Compress the binary for upload. The -j flag is necessary to avoid the
# /vagrant path being in the zip too. Only the zip gets the version number, so # /vagrant path being in the zip too. Only the zip gets the version number, so
# the binaries can have consistent names, but its still possible to tell # the binaries can have consistent names, and its still possible to tell
# different *downloads* apart. # different *downloads* apart.
echo -e "\n\033[4mZipping binary...\033[0m" echo -e "\n\033[4mZipping binary...\033[0m"
exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}.zip" exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}.zip"