Remove resourcePath and devResourcePath assignment from parseCommandLine

This commit is contained in:
David Wilson
2018-08-22 12:41:36 -07:00
parent bb1f7b0a2f
commit f31471707d
2 changed files with 14 additions and 18 deletions

View File

@@ -3,10 +3,8 @@
const dedent = require('dedent')
const yargs = require('yargs')
const {app} = require('electron')
const path = require('path')
const fs = require('fs-plus')
module.exports = function parseCommandLine (processArgs, resourcePath, devResourcePath) {
module.exports = function parseCommandLine (processArgs) {
const options = yargs(processArgs).wrap(yargs.terminalWidth())
const version = app.getVersion()
options.usage(
@@ -128,7 +126,7 @@ module.exports = function parseCommandLine (processArgs, resourcePath, devResour
}
}
if (args['resource-path'] || test) {
if (args.resourcePath || test) {
devMode = true
}
@@ -138,12 +136,7 @@ module.exports = function parseCommandLine (processArgs, resourcePath, devResour
process.env.PATH = args['path-environment']
}
resourcePath = normalizeDriveLetterName(resourcePath)
devResourcePath = normalizeDriveLetterName(devResourcePath)
return {
resourcePath,
devResourcePath,
pathsToOpen,
urlsToOpen,
executedFrom,
@@ -166,11 +159,3 @@ module.exports = function parseCommandLine (processArgs, resourcePath, devResour
env: process.env
}
}
function normalizeDriveLetterName (filePath) {
if (process.platform === 'win32' && filePath) {
return filePath.replace(/^([a-z]):/, ([driveLetter]) => driveLetter.toUpperCase() + ':')
} else {
return filePath
}
}

View File

@@ -37,7 +37,10 @@ module.exports = function start (resourcePath, devResourcePath, startTime) {
app.commandLine.appendSwitch('enable-experimental-web-platform-features')
const args = parseCommandLine(process.argv.slice(1), resourcePath, devResourcePath)
const args = parseCommandLine(process.argv.slice(1))
args.resourcePath = normalizeDriveLetterName(resourcePath)
args.devResourcePath = normalizeDriveLetterName(devResourcePath)
atomPaths.setAtomHome(app.getPath('home'))
atomPaths.setUserData(app)
setupCompileCache()
@@ -124,3 +127,11 @@ function getConfig () {
return config
}
function normalizeDriveLetterName (filePath) {
if (process.platform === 'win32' && filePath) {
return filePath.replace(/^([a-z]):/, ([driveLetter]) => driveLetter.toUpperCase() + ':')
} else {
return filePath
}
}