Skip to content

Commit

Permalink
Fix atom.sh when running from directory with space
Browse files Browse the repository at this point in the history
Deal with ATOM_PATH having a space by proper quoting, and not passing
the directory name to dirname.

Fixes atom#4336
  • Loading branch information
Paul Wagland committed Nov 27, 2014
1 parent de619a7 commit 5da4846
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ if [ $REDIRECT_STDERR ]; then
fi

if [ $OS == 'Mac' ]; then
ATOM_PATH=${ATOM_PATH:-/Applications} # Set ATOM_PATH unless it is already set
ATOM_PATH="${ATOM_PATH:-/Applications}" # Set ATOM_PATH unless it is already set
ATOM_APP_NAME=Atom.app

# If ATOM_PATH isn't a executable file, use spotlight to search for Atom
if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
ATOM_PATH=$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs dirname)
ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | sed '{s#/[^/]*$##; q; }')"
fi

# Exit if Atom can't be found
Expand Down

0 comments on commit 5da4846

Please sign in to comment.