summaryrefslogtreecommitdiff
path: root/development/atom/fix-atom.sh.patch
diff options
context:
space:
mode:
authorDhabyX <slack.dhabyx@gmail.com>2017-02-26 09:40:08 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-02-26 10:05:30 +0700
commit04ddd3aa73efab669eb5972895872a72238b6012 (patch)
treedee1d6721b6f6051629aafcdb1aba6ad7e0fd73f /development/atom/fix-atom.sh.patch
parent2969e9859604c541b34d7735abc4bc04d5839682 (diff)
downloadslackbuilds-04ddd3aa73efab669eb5972895872a72238b6012.tar.gz
development/atom: Updated for version 1.14.3.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/atom/fix-atom.sh.patch')
-rw-r--r--development/atom/fix-atom.sh.patch115
1 files changed, 115 insertions, 0 deletions
diff --git a/development/atom/fix-atom.sh.patch b/development/atom/fix-atom.sh.patch
new file mode 100644
index 0000000000..c65ae86d90
--- /dev/null
+++ b/development/atom/fix-atom.sh.patch
@@ -0,0 +1,115 @@
+diff -Naur a/atom.sh c/atom.sh
+--- a/atom.sh 2017-02-17 10:53:06.000000000 -0600
++++ c/atom.sh 2017-02-24 23:45:17.745685040 -0600
+@@ -1,14 +1,5 @@
+ #!/bin/bash
+
+-if [ "$(uname)" == 'Darwin' ]; then
+- OS='Mac'
+-elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then
+- OS='Linux'
+-else
+- echo "Your platform ($(uname -a)) is not supported."
+- exit 1
+-fi
+-
+ if [ "$(basename $0)" == 'atom-beta' ]; then
+ BETA_VERSION=true
+ else
+@@ -54,79 +45,29 @@
+ export ELECTRON_ENABLE_LOGGING=1
+ fi
+
+-if [ $OS == 'Mac' ]; then
+- if [ -L "$0" ]; then
+- SCRIPT="$(readlink "$0")"
+- else
+- SCRIPT="$0"
+- fi
+- ATOM_APP="$(dirname "$(dirname "$(dirname "$(dirname "$SCRIPT")")")")"
+- if [ "$ATOM_APP" == . ]; then
+- unset ATOM_APP
+- else
+- ATOM_PATH="$(dirname "$ATOM_APP")"
+- ATOM_APP_NAME="$(basename "$ATOM_APP")"
+- fi
+-
+- if [ -n "$BETA_VERSION" ]; then
+- ATOM_EXECUTABLE_NAME="Atom Beta"
+- else
+- ATOM_EXECUTABLE_NAME="Atom"
+- fi
+-
+- if [ -z "${ATOM_PATH}" ]; then
+- # If ATOM_PATH isn't set, check /Applications and then ~/Applications for Atom.app
+- if [ -x "/Applications/$ATOM_APP_NAME" ]; then
+- ATOM_PATH="/Applications"
+- elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then
+- ATOM_PATH="$HOME/Applications"
+- else
+- # We haven't found an Atom.app, use spotlight to search for Atom
+- ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
+-
+- # Exit if Atom can't be found
+- if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
+- echo "Cannot locate ${ATOM_APP_NAME}, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing ${ATOM_APP_NAME}."
+- exit 1
+- fi
+- fi
+- fi
+
+- if [ $EXPECT_OUTPUT ]; then
+- "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@"
+- exit $?
+- else
+- open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"
+- fi
+-elif [ $OS == 'Linux' ]; then
+- SCRIPT=$(readlink -f "$0")
+- USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
+-
+- 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"
++if [ -n "$BETA_VERSION" ]; then
++ ATOM_PATH="electron --app=/usr/share/atom-beta/atom"
++else
++ ATOM_PATH="electron --app=/usr/share/atom"
++fi
+
+- : ${TMPDIR:=/tmp}
++ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
++mkdir -p "$ATOM_HOME"
+
+- [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom"
++: ${TMPDIR:=/tmp}
+
+- if [ $EXPECT_OUTPUT ]; then
+- "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
++if [ $EXPECT_OUTPUT ]; then
++ $ATOM_PATH --executed-from="$(pwd)" --pid=$$ "$@"
++ exit $?
++else
++ (
++ nohup $ATOM_PATH --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
++ if [ $? -ne 0 ]; then
++ cat "$ATOM_HOME/nohup.out"
+ exit $?
+- else
+- (
+- nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
+- if [ $? -ne 0 ]; then
+- cat "$ATOM_HOME/nohup.out"
+- exit $?
+- fi
+- ) &
+ fi
++ ) &
+ fi
+
+ # Exits this process when Atom is used as $EDITOR