Skip to content

Commit

Permalink
Use beta version when shell script is launched as 'atom-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Sep 23, 2015
1 parent a9531fc commit b944061
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions atom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ else
exit 1
fi

if [ "$(basename $0)" == 'atom-beta' ]; then
BETA_VERSION=true
else
BETA_VERSION=
fi

while getopts ":wtfvh-:" opt; do
case "$opt" in
-)
Expand Down Expand Up @@ -45,7 +51,11 @@ if [ $REDIRECT_STDERR ]; then
fi

if [ $OS == 'Mac' ]; then
ATOM_APP_NAME=Atom.app
if [ -n "$BETA_VERSION" ]; then
ATOM_APP_NAME="Atom Beta.app"
else
ATOM_APP_NAME="Atom.app"
fi

if [ -z "${ATOM_PATH}" ]; then
# If ATOM_PATH isnt set, check /Applications and then ~/Applications for Atom.app
Expand Down Expand Up @@ -74,9 +84,14 @@ if [ $OS == 'Mac' ]; then
elif [ $OS == 'Linux' ]; then
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"

if [ -n "$BETA_VERSION" ]; then
ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom"
else
ATOM_PATH="$USR_DIRECTORY/share/atom/atom "
fi

ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
mkdir -p "$ATOM_HOME"

: ${TMPDIR:=/tmp}
Expand Down

0 comments on commit b944061

Please sign in to comment.