From baccfe544bf9afeb3c07bccad4bd8e3109d7d733 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sun, 1 Oct 2017 10:55:38 +0200 Subject: [PATCH] Linux check for Linux script These changes are mostly just to mirror the macOS packaging script. --- devtools/dev-package-for-linux.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devtools/dev-package-for-linux.sh b/devtools/dev-package-for-linux.sh index defa0c6..ff64c5e 100644 --- a/devtools/dev-package-for-linux.sh +++ b/devtools/dev-package-for-linux.sh @@ -8,6 +8,13 @@ set -e # If you’re 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. # 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 @@ -17,7 +24,7 @@ toml_file="/vagrant/Cargo.toml" eval exa_$(grep version $toml_file | head -n 1 | sed "s/ //g") if [ -z "$exa_version" ]; then echo "Failed to parse version number! Can't build exa!" - exit + exit 1 else echo "Building exa v$exa_version" fi @@ -40,7 +47,7 @@ strip -v "$exa_linux_binary" # 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 -# the binaries can have consistent names, but it’s still possible to tell +# the binaries can have consistent names, and it’s still possible to tell # different *downloads* apart. echo -e "\n\033[4mZipping binary...\033[0m" exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}.zip"