From 54ce852be495d077f100d20331a5328814da454d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 24 Jul 2014 09:27:47 -0700 Subject: [PATCH] Store nohup.out in ~/.atom Storing it in the temp directory can lead to permissions issues when Atom is run by multiple users. Closes #3056 --- atom.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/atom.sh b/atom.sh index ddeba08d9..2e8d9edd9 100755 --- a/atom.sh +++ b/atom.sh @@ -69,6 +69,11 @@ elif [ $OS == 'Linux' ]; then SCRIPT=$(readlink -f "$0") USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) ATOM_PATH="$USR_DIRECTORY/share/atom/atom" + DOT_ATOM_DIR = "$HOME/.atom" + + if [ ! -d "$DOT_ATOM_DIR" ]; then + mkdir -p "$DOT_ATOM_DIR" + fi : ${TMPDIR:=/tmp} @@ -79,9 +84,9 @@ elif [ $OS == 'Linux' ]; then exit $? else ( - nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$TMPDIR/atom-nohup.out" 2>&1 + nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$DOT_ATOM_DIR/nohup.out" 2>&1 if [ $? -ne 0 ]; then - cat "$TMPDIR/atom-nohup.out" + cat "$DOT_ATOM_DIR/nohup.out" exit $? fi ) &