Files
colorshell/scripts/start.sh
T

30 lines
902 B
Bash

source ./scripts/utils.sh
file="${1:-./build/colorshell}"
function start() {
if Is_running; then
echo "[info] killing previous instance"
colorshell quit || killall gjs 2>/dev/null || true
fi
echo "[info] starting"
# Always run through nix develop to ensure proper environment variables are set
# This is needed because the manually built executable doesn't have wrapGAppsHook
if command -v nix > /dev/null 2>&1; then
# Use nix develop -c to run with proper environment
# The -c flag runs the command in the devshell environment
exec nix develop -c bash -c "exec \"$file\" \"\$@\"" -- "$@"
else
exec "$file" "$@"
fi
}
if [[ -f $file ]]; then
start
else
echo "[error] can't start project: no executable found on default directory"
echo "[tip] specify the executable path: start \"\$path\""
exit 1
fi