Просмотр исходного кода

Linux check for Linux script

These changes are mostly just to mirror the macOS packaging script.
Benjamin Sago 8 лет назад
Родитель
Сommit
baccfe544b
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      devtools/dev-package-for-linux.sh

+ 9 - 2
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"