mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-12 15:44:40 +08:00
refactor(n1): Update N1.sh to use N1_PATH instead of EDGEHILL_PATH
This commit is contained in:
parent
f6ef8a8b0c
commit
6d14e36e71
3 changed files with 18 additions and 15 deletions
23
N1.sh
Normal file → Executable file
23
N1.sh
Normal file → Executable file
|
@ -47,43 +47,46 @@ if [ $REDIRECT_STDERR ]; then
|
|||
exec 2> /dev/null
|
||||
fi
|
||||
|
||||
N1_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
export N1_PATH
|
||||
|
||||
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."
|
||||
if [ -z "$N1_PATH" ]; then
|
||||
echo "Set the N1_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
|
||||
ELECTRON_PATH=${ELECTRON_PATH:-$N1_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 electron. Be sure you have run script/grunt download-electron first from $EDGEHILL_PATH"
|
||||
echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $N1_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We find the electron executable inside of the electron directory.
|
||||
$ELECTRON_PATH/Electron.app/Contents/MacOS/Electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH
|
||||
$ELECTRON_PATH/Electron.app/Contents/MacOS/Electron --executed-from="$(pwd)" --pid=$$ "$@" $N1_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."
|
||||
if [ -z "$N1_PATH" ]; then
|
||||
echo "Set the N1_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
|
||||
ELECTRON_PATH=${ELECTRON_PATH:-$N1_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 electron. Be sure you have run script/grunt download-electron first from $EDGEHILL_PATH"
|
||||
echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $N1_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We find the electron executable inside of the electron directory.
|
||||
$ELECTRON_PATH/electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH
|
||||
$ELECTRON_PATH/electron --executed-from="$(pwd)" --pid=$$ "$@" $N1_PATH
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ start = ->
|
|||
Application.open(args)
|
||||
console.log("App load time: #{Date.now() - global.shellStartTime}ms") unless args.test
|
||||
|
||||
global.devResourcePath = process.env.EDGEHILL_PATH ? process.cwd()
|
||||
global.devResourcePath = process.env.N1_PATH ? process.cwd()
|
||||
# Normalize to make sure drive letter case is consistent on Windows
|
||||
global.devResourcePath = path.normalize(global.devResourcePath) if global.devResourcePath
|
||||
|
||||
|
@ -90,8 +90,8 @@ parseCommandLine = ->
|
|||
opened or a new window if it hasn't.
|
||||
|
||||
Environment Variables:
|
||||
EDGEHILL_PATH The path from which Atom loads source code in dev mode.
|
||||
Defaults to `cwd`.
|
||||
N1_PATH The path from which Atom loads source code in dev mode.
|
||||
Defaults to `cwd`.
|
||||
"""
|
||||
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.')
|
||||
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.')
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
global.devResourcePath = (ref = process.env.EDGEHILL_PATH) != null ? ref : process.cwd();
|
||||
global.devResourcePath = (ref = process.env.N1_PATH) != null ? ref : process.cwd();
|
||||
|
||||
if (global.devResourcePath) {
|
||||
global.devResourcePath = path.normalize(global.devResourcePath);
|
||||
|
@ -103,7 +103,7 @@
|
|||
var args, devMode, executedFrom, logFile, newWindow, options, packageDirectoryPath, packageManifest, packageManifestPath, pathsToOpen, pidToKillWhenClosed, resourcePath, safeMode, specDirectory, specFilePattern, specsOnCommandLine, test, version;
|
||||
version = app.getVersion();
|
||||
options = optimist(process.argv.slice(1));
|
||||
options.usage("Atom Editor v" + version + "\n\nUsage: atom [options] [path ...]\n\nOne or more paths to files or folders to open may be specified.\n\nFile paths will open in the current window.\n\nFolder paths will open in an existing window if that folder has already been\nopened or a new window if it hasn't.\n\nEnvironment Variables:\nEDGEHILL_PATH The path from which Atom loads source code in dev mode.\n Defaults to `cwd`.");
|
||||
options.usage("Atom Editor v" + version + "\n\nUsage: atom [options] [path ...]\n\nOne or more paths to files or folders to open may be specified.\n\nFile paths will open in the current window.\n\nFolder paths will open in an existing window if that folder has already been\nopened or a new window if it hasn't.\n\nEnvironment Variables:\nN1_PATH The path from which Atom loads source code in dev mode.\n Defaults to `cwd`.");
|
||||
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.');
|
||||
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.');
|
||||
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.');
|
||||
|
|
Loading…
Add table
Reference in a new issue