Change cross-spawn dependency to be optionalDependency
Closes #573, #795, #922, #858, #925, #761, #902, #740. If cross-spawn fails to install, atom-beautify will still continue to install and work without it, with degraded support for Windows, such as ignoring PATHEXT.
This commit is contained in:
parent
1e282de280
commit
c950557438
|
@ -88,7 +88,6 @@
|
|||
"coffee-fmt": "0.11.0",
|
||||
"coffee-formatter": "^0.1.2",
|
||||
"coffee-script": "^1.10.0",
|
||||
"cross-spawn": "^2.0.0",
|
||||
"csscomb": "^3.1.7",
|
||||
"diff": "^2.1.0",
|
||||
"editorconfig": "^0.12.2",
|
||||
|
@ -117,6 +116,9 @@
|
|||
"winston": "^1.0.0",
|
||||
"yaml-front-matter": "^3.2.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"cross-spawn": "^2.0.0"
|
||||
},
|
||||
"activationCommands": {
|
||||
"atom-workspace": [
|
||||
"atom-beautify:help-debug-editor",
|
||||
|
|
|
@ -2,9 +2,14 @@ Promise = require("bluebird")
|
|||
_ = require('lodash')
|
||||
fs = require("fs")
|
||||
temp = require("temp").track()
|
||||
spawn = require('cross-spawn')
|
||||
readFile = Promise.promisify(fs.readFile)
|
||||
which = require('which')
|
||||
# Get optional dependency cross-spawn
|
||||
spawn = null
|
||||
try
|
||||
spawn = require('cross-spawn')
|
||||
catch err
|
||||
spawn = require('child_process').spawn
|
||||
|
||||
module.exports = class Beautifier
|
||||
|
||||
|
|
Loading…
Reference in New Issue