Merge pull request #2172 from resin-io/fix-inherit-env-windows

fix(image-writer): Don't inherit environment on Windows
This commit is contained in:
Jonas Hermsmeier 2018-04-05 16:43:13 +02:00 committed by GitHub
commit 0d1b9641c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,20 +173,22 @@ exports.performWrite = (image, drives, onProgress) => {
ipc.server.on('start', () => {
console.log(`Elevating command: ${_.join(argv, ' ')}`)
const env = _.assign({}, process.platform === 'win32' ? {} : process.env, {
IPC_SERVER_ID,
IPC_CLIENT_ID,
IPC_SOCKET_ROOT: ipc.config.socketRoot,
ELECTRON_RUN_AS_NODE: 1,
UV_THREADPOOL_SIZE: os.cpus().length * THREADS_PER_CPU,
// This environment variable prevents the AppImages
// desktop integration script from presenting the
// "installation" dialog
SKIP: 1
})
permissions.elevateCommand(argv, {
applicationName: packageJSON.displayName,
environment: _.assign({}, process.env, {
IPC_SERVER_ID,
IPC_CLIENT_ID,
IPC_SOCKET_ROOT: ipc.config.socketRoot,
ELECTRON_RUN_AS_NODE: 1,
UV_THREADPOOL_SIZE: os.cpus().length * THREADS_PER_CPU,
// This environment variable prevents the AppImages
// desktop integration script from presenting the
// "installation" dialog
SKIP: 1
})
environment: env
}).then((results) => {
flashResults.cancelled = results.cancelled
console.log('Flash results', flashResults)