Mailspring/atom.sh
Ben Gotow 8133cc88d6 feat(logging): Developer bar, verbose logging to logstash, Electron 0.26.0
Summary:
- We now make verbose log files continuously as you use the app
- We ship the logs to LogStash via S3 when an exception occurs
- We log the DatabaseStore, ActionBridge and Analytics packages

- We are now on the latest version of Electron 0.26.0
- We are now on Chrome 42 and io.js 1.4.3
- We should be setup to use ASAR soon.

Update atom.sh to reflect that we're now electron

oniguruma was unnecessary

correctly find log files that haven't been shipped yet

Fix a small issue with nodeIsVisible after upgrade to Chrome 42

Delete old logs, better logging from database store, don't ship empty logs

Test Plan: Run existing tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1531
2015-05-19 17:02:46 -07:00

101 lines
2.4 KiB
Bash
Executable file

#!/bin/bash
# This file is sym-linked to the `electron` executable.
# It is used by `apm` when calling commands.
if [ "$(uname)" == 'Darwin' ]; then
OS='Mac'
elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then
OS='Linux'
elif [ "$(expr substr $(uname -s) 1 10)" == 'MINGW32_NT' ]; then
OS='Cygwin'
else
echo "Your platform ($(uname -a)) is not supported."
exit 1
fi
while getopts ":wtfvh-:" opt; do
case "$opt" in
-)
case "${OPTARG}" in
wait)
WAIT=1
;;
help|version)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
foreground|test)
EXPECT_OUTPUT=1
;;
esac
;;
w)
WAIT=1
;;
h|v)
REDIRECT_STDERR=1
EXPECT_OUTPUT=1
;;
f|t)
EXPECT_OUTPUT=1
;;
esac
done
if [ $REDIRECT_STDERR ]; then
exec 2> /dev/null
fi
if [ $OS == 'Mac' ]; then
if [ -z "$EDGEHILL_PATH" ]; then
echo "Set the EDGEHILL_PATH environment variable to the absolute location of the main edgehill folder."
exit 1
fi
ELECTRON_PATH=${ELECTRON_PATH:-$EDGEHILL_PATH/atom-shell} # Set ELECTRON_PATH unless it is already set
# Exit if Atom can't be found
if [ -z "$ELECTRON_PATH" ]; then
echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $EDGEHILL_PATH"
exit 1
fi
# We find the atom-shell executable inside of the atom-shell directory.
$ELECTRON_PATH/Electron.app/Contents/MacOS/Electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH
elif [ $OS == 'Linux' ]; then
DOT_INBOX_DIR="$HOME/.nylas"
mkdir -p "$DOT_INBOX_DIR"
if [ -z "$EDGEHILL_PATH" ]; then
echo "Set the EDGEHILL_PATH environment variable to the absolute location of the main edgehill folder."
exit 1
fi
ELECTRON_PATH=${ELECTRON_PATH:-$EDGEHILL_PATH/electron} # Set ELECTRON_PATH unless it is already set
# Exit if Atom can't be found
if [ -z "$ELECTRON_PATH" ]; then
echo "Cannot locate atom-shell. Be sure you have run script/grunt download-atom-shell first from $EDGEHILL_PATH"
exit 1
fi
# We find the electron executable inside of the atom-shell directory.
$ELECTRON_PATH/electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH
fi
# Exits this process when Atom is used as $EDITOR
on_die() {
exit 0
}
trap 'on_die' SIGQUIT SIGTERM
# If the wait flag is set, don't exit this process until Atom tells it to.
if [ $WAIT ]; then
while true; do
sleep 1
done
fi