Skip to content

Commit e3ccff6

Browse files
committed
Add restart command to cli
1 parent 970ad8b commit e3ccff6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: src/cli/daemon.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const uninstall = require("../scripts/uninstall");
88

99
module.exports = {
1010
start,
11-
stop
11+
stop,
12+
restart
1213
};
1314

1415
// Start daemon in background
@@ -34,3 +35,9 @@ function stop() {
3435
uninstall();
3536
console.log("Stopped");
3637
}
38+
39+
// Restart daemon
40+
function restart() {
41+
stop();
42+
start();
43+
}

Diff for: src/cli/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ module.exports = processArgv =>
9090
.command("ls", "List servers", {}, argv => servers.ls(argv))
9191
.command("start", "Start daemon", {}, () => daemon.start())
9292
.command("stop", "Stop daemon", {}, () => daemon.stop())
93+
.command("restart", "Restart daemon", {}, () => daemon.restart())
9394
.example("$0 add --help")
9495
.example("$0 add nodemon")
9596
.example("$0 add npm start")

0 commit comments

Comments
 (0)