Skip to content

Instantly share code, notes, and snippets.

@codebrainz
Created July 27, 2025 21:25
Show Gist options
  • Select an option

  • Save codebrainz/458764e4e337a4e50a0bf155cc17de62 to your computer and use it in GitHub Desktop.

Select an option

Save codebrainz/458764e4e337a4e50a0bf155cc17de62 to your computer and use it in GitHub Desktop.
#!/bin/bash
MODE="raspi"
ARGS=()
for arg in "$@"; do
case $arg in
MODE=*) MODE="${arg#MODE=}" ;;
*) ARGS+=("$arg") ;;
esac
done
./run_$MODE debug &
./debug ${ARGS[*]}
#osascript <<EOF
#tell application "Terminal"
# do script "cd \"$PWD\"; ./run_$MODE debug"
# do script "cd \"$PWD\"; ./debug ${ARGS[*]}"
#end tell
#EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment