Skip to content

Commit d3640ee

Browse files
committed
wip
1 parent 795d576 commit d3640ee

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/factory-daemon.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,29 @@ class FactoryDaemon {
124124
const node = new Daemon(options)
125125

126126
series([
127-
128-
// TODO if init fails, check if it was because the
129-
// repo was already was inited, if yes, continue
130127
(cb) => options.init
131-
? node.init(options.initOptions, cb)
128+
? node.init(options.initOptions, (err) => {
129+
if (err) {
130+
console.log(err)
131+
// TODO if init fails, check if it was because the
132+
// repo was already was inited, if yes, continue
133+
cb(err)
134+
} else {
135+
cb()
136+
}
137+
})
132138
: cb(null, node),
133-
// TODO if start fails, check if it was because there
134-
// is a daemon already running and connect to it instead
135139
(cb) => options.start
136-
? node.start(options.args, cb)
140+
? node.start(options.args, (err) => {
141+
if (err) {
142+
console.log(err)
143+
// TODO if start fails, check if it was because there
144+
// is a daemon already running and connect to it instead
145+
cb(err)
146+
} else {
147+
cb()
148+
}
149+
})
137150
: cb()
138151
], (err) => {
139152
if (err) { return callback(err) }

0 commit comments

Comments
 (0)