Merge branch 'master' into ns-switch-to-display-layers

This commit is contained in:
Antonio Scandurra
2016-04-13 13:54:13 +02:00
18 changed files with 975 additions and 25 deletions

View File

@@ -466,6 +466,7 @@ class AtomApplication
openedWindow.restore()
else
openedWindow.focus()
openedWindow.replaceEnvironment(env)
else
if devMode
try

View File

@@ -68,6 +68,7 @@ class AtomWindow
@loaded = true
@setLoadSettings(loadSettings)
@env = loadSettings.env if loadSettings.env?
@browserWindow.focusOnWebView() if @isSpec
@browserWindow.temporaryState = {windowDimensions} if windowDimensions?
@@ -169,6 +170,9 @@ class AtomWindow
else
@browserWindow.once 'window:loaded', => @openLocations(locationsToOpen)
replaceEnvironment: (env) ->
@browserWindow.webContents.send 'environment', env
sendMessage: (message, detail) ->
@browserWindow.webContents.send 'message', message, detail

View File

@@ -67,7 +67,7 @@ class BufferedProcess
cmdArgs.unshift("\"#{command}\"")
else
cmdArgs.unshift(command)
cmdArgs = ['/s', '/c', "\"#{cmdArgs.join(' ')}\""]
cmdArgs = ['/s', '/d', '/c', "\"#{cmdArgs.join(' ')}\""]
cmdOptions = _.clone(options)
cmdOptions.windowsVerbatimArguments = true
@spawn(@getCmdPath(), cmdArgs, cmdOptions)

View File

@@ -91,4 +91,12 @@ function normalize (options = {}) {
}
}
export default { getFromShell, needsPatching, normalize }
function replace (env) {
if (!env || !env.PATH) {
return
}
process.env = env
}
export default { getFromShell, needsPatching, normalize, replace }

View File

@@ -40,7 +40,7 @@ export default class GitRepositoryAsync {
constructor (_path, options = {}) {
// We'll serialize our access manually.
Git.disableThreadSafety()
Git.setThreadSafetyStatus(Git.THREAD_SAFETY.DISABLED)
this.emitter = new Emitter()
this.subscriptions = new CompositeDisposable()

View File

@@ -4,11 +4,12 @@ module.exports = ({blobStore}) ->
path = require 'path'
require './window'
{getWindowLoadSettings} = require './window-load-settings-helpers'
{ipcRenderer} = require 'electron'
{resourcePath, isSpec, devMode, env} = getWindowLoadSettings()
# Set baseline environment
environmentHelpers.normalize({env: env})
env = process.env
# Add application-specific exports to module search path.
exportsPath = path.join(resourcePath, 'exports')
@@ -25,7 +26,7 @@ module.exports = ({blobStore}) ->
applicationDelegate: new ApplicationDelegate,
configDirPath: process.env.ATOM_HOME
enablePersistence: true
env: env
env: process.env
})
atom.startEditorWindow().then ->
@@ -35,3 +36,6 @@ module.exports = ({blobStore}) ->
window.removeEventListener('focus', windowFocused)
setTimeout (-> document.querySelector('atom-workspace').focus()), 0
window.addEventListener('focus', windowFocused)
ipcRenderer.on('environment', (event, env) ->
environmentHelpers.replace(env)
)

View File

@@ -367,6 +367,8 @@ class PackageManager
@emitter.emit 'did-load-initial-packages'
loadPackage: (nameOrPath) ->
return null if path.basename(nameOrPath)[0].match /^\./ # primarily to skip .git folder
return pack if pack = @getLoadedPackage(nameOrPath)
if packagePath = @resolvePackagePath(nameOrPath)