aboutsummaryrefslogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorGravatar BanceDev 2025-02-07 14:33:33 -0500
committerGravatar BanceDev 2025-02-07 14:33:33 -0500
commite373f9a259ca6e32584540e7b9fec7de93a1567d (patch)
tree4e179438b47cf533eca5c1993e31eea0a198a78c /update.sh
parentadded command string mode (diff)
added trap builtin
Diffstat (limited to 'update.sh')
-rw-r--r--update.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100644
index 0000000..58e1e2f
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+premake5 gmake
+make
+if [ ! -d ~/.lush ]; then
+ cp -rf ./.lush ~/
+fi
+
+# always update example
+cp -f ./.lush/scripts/example.lua ~/.lush/scripts/example.lua
+
+# Install the new shell binary to a temporary location
+sudo cp ./bin/Debug/lush/lush /usr/bin/lush.new
+
+# Atomically replace the old binary
+sudo mv /usr/bin/lush.new /usr/bin/lush
+
+# Ensure the shell is registered in /etc/shells
+if ! grep -Fxq "/usr/bin/lush" /etc/shells; then
+ echo "/usr/bin/lush" | sudo tee -a /etc/shells >/dev/null
+fi
+
+echo "====================="
+echo " UPDATE FINISHED "
+echo "====================="