🔧 chore(scripts): better build script, stop current running instance before starting a new one

This commit is contained in:
retrozinndev
2025-08-09 20:44:09 -03:00
parent fa23e658a0
commit ead5e11cfc
2 changed files with 71 additions and 4 deletions
+16
View File
@@ -1,6 +1,22 @@
file="${1:-./build/colorshell}"
function is_running() {
if gdbus introspect --session \
--dest io.github.retrozinndev.colorshell \
--object-path /io/github/retrozinndev/colorshell > /dev/null 2>&1
then
return 0
fi
return 1
}
function start() {
if is_running; then
echo "[info] killing previous instance"
killall gjs # TODO: call a method to quit via dbus instead of killing GnomeJS
fi
echo "[info] starting"
exec "$file"
}