Skip to content

Commit

Permalink
Detach CLI process from terminal (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfgordon2 authored and shiftkey committed Dec 18, 2023
1 parent 9c4d142 commit 135511f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/static/linux/github
Expand Up @@ -23,6 +23,13 @@ fi
ELECTRON="$GITHUB_PATH/$BINARY_NAME"
CLI="$GITHUB_PATH/resources/app/cli.js"

ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
case $1 in
# if help in the first variable, return contents to shell
*help*|*--help*)
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@";;
# any other, redirect to /dev/null to detach from controlling terminal
*)
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" < /dev/null > /dev/null &;;
esac

exit $?

0 comments on commit 135511f

Please sign in to comment.