Created
August 25, 2014 05:36
-
-
Save britzl/60145e7179b66eb2d4e9 to your computer and use it in GitHub Desktop.
Shell script to download an OS specific Lua 5.1 binary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Downloads an OS specific Lua 5.1 binary | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/lua-5.1.5_Linux32_64_bin.tar.gz/download" | |
LUA_BINARY=lua5.1 | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/lua-5.1.5_MacOS109_bin.tar.gz/download" | |
LUA_BINARY=lua5.1 | |
elif [[ "$OSTYPE" == "win32" ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Executables/lua5_1_5_Win32_bin.zip/download" | |
LUA_BINARY=lua5.1.exe | |
elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/lua-5.1.5_Win32_cygw17_bin.zip/download" | |
LUA_BINARY=lua5.1.exe | |
else | |
echo "No Lua binary available for OS $OSTYPE" | |
exit 1 | |
fi | |
echo "Downloading Lua binary from $LUA_DOWNLOAD_URL" | |
curl -o lua.tar.gz -L $LUA_DOWNLOAD_URL | |
tar -xzf lua.tar.gz $LUA_BINARY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment