dotfiles/scripts/lua.sh

31 lines
595 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2022-08-19 13:49:23 +00:00
VERSION="5.4.4"
function install () {
cd ~
2021-11-24 14:14:39 +00:00
wget https://www.lua.org/ftp/lua-${VERSION}.tar.gz
sudo tar zxf lua-${VERSION}.tar.gz
cd lua-${VERSION}
2022-08-19 13:49:23 +00:00
sudo make -j $(nproc)
sudo make install -j $(nproc)
cd ~
2021-11-24 14:14:39 +00:00
sudo rm -rf lua-${VERSION}
sudo rm lua-${VERSION}.tar.gz
2021-08-17 05:08:52 +00:00
printf "\n"
lua -v
}
function uninstall () {
sudo rm -rf /usr/local/bin/lua
sudo rm -rf /usr/local/lib/lua
}
if [ "$1" == "install" ]; then
install
elif [ "$1" == "uninstall" ] || [ "$1" == "remove" ]; then
uninstall
else
echo "please specify args with install or uninstall"
2021-11-24 14:14:39 +00:00
fi