diff --git a/atom.sh b/atom.sh index cd1137051..03bb758c8 100755 --- a/atom.sh +++ b/atom.sh @@ -66,8 +66,8 @@ if [ $OS == 'Mac' ]; then open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ "$@" fi elif [ $OS == 'Linux' ]; then - ATOM_PATH='/opt/Atom/atom' - [ -x "$ATOM_PATH" ] || ATOM_PATH='/tmp/atom-build/Atom/atom' + ATOM_PATH='/opt/atom/atom' + [ -x "$ATOM_PATH" ] || ATOM_PATH='/tmp/atom-build/atom/atom' if [ $EXPECT_OUTPUT ]; then "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 118824f1f..ef8352b20 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -39,35 +39,33 @@ module.exports = (grunt) -> if process.platform is 'win32' appName = 'Atom' tmpDir = os.tmpdir() - installRoot = process.env.ProgramFiles buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') atomShellDownloadDir = path.join(os.tmpdir(), 'atom-cached-atom-shells') + installDir = path.join(process.env.ProgramFiles, appName) else if process.platform is 'darwin' appName = 'Atom.app' tmpDir = '/tmp' - installRoot = '/Applications' buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) contentsDir = path.join(shellAppDir, 'Contents') appDir = path.join(contentsDir, 'Resources', 'app') atomShellDownloadDir = '/tmp/atom-cached-atom-shells' + installDir = path.join('/Applications', appName) else - appName = 'Atom' + appName = 'atom' tmpDir = '/tmp' - installRoot = '/opt' buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') atomShellDownloadDir = '/tmp/atom-cached-atom-shells' - - installDir = path.join(installRoot, appName) + installDir = process.env.INSTALL_PREFIX ? '/usr/local' coffeeConfig = options: diff --git a/build/tasks/install-task.coffee b/build/tasks/install-task.coffee index 273e1b5ef..cc98f1e8c 100644 --- a/build/tasks/install-task.coffee +++ b/build/tasks/install-task.coffee @@ -15,7 +15,14 @@ module.exports = (grunt) -> createShortcut = path.resolve 'script', 'create-shortcut.cmd' runas('cmd', ['/c', createShortcut, path.join(installDir, 'atom.exe'), 'Atom']) - else + else if process.platform is 'darwin' rm installDir mkdir path.dirname(installDir) cp shellAppDir, installDir + else + binDir = path.join(installDir, 'bin') + shareDir = path.join(installDir, 'share') + + mkdir binDir + cp 'atom.sh', path.join(binDir, 'atom') + cp shellAppDir, shareDir