Skip to content

Commit 5058a91

Browse files
author
Aaron Dayalan
committed
require will throw if the package.json file doesnt exist
1 parent ad07ec1 commit 5058a91

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/debugger.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ childprocess = require 'child_process'
77
{EventEmitter} = require './eventing'
88
Event = require 'geval/event'
99
logger = require './logger'
10+
fs = require 'fs'
1011

1112
log = (msg) -> # console.log(msg)
1213

@@ -30,7 +31,8 @@ class ProcessManager extends EventEmitter
3031
startActive = withActiveFile
3132
@cleanup()
3233
.then =>
33-
packageJSON = require @atom.project.resolvePath('package.json')
34+
packagePath = @atom.project.resolvePath('package.json')
35+
packageJSON = require packagePath if fs.existsSync(packagePath)
3436
nodePath = @atom.config.get('node-debugger.nodePath')
3537
nodeArgs = @atom.config.get('node-debugger.nodeArgs')
3638
appArgs = @atom.config.get('node-debugger.appArgs')

0 commit comments

Comments
 (0)