Skip to content

Commit

Permalink
add restart command
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed Apr 18, 2018
1 parent f17c4db commit 258fb6b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ alias docker="supdock"
```

#### Go
A Golang version is also available.
A more optimal Golang version is also available and is maintained more frequently.

```bash
curl https://raw.githubusercontent.com/segersniels/supdock-go/master/supdock-go > /usr/local/bin/supdock ; chmod +x /usr/local/bin/supdock
Expand All @@ -49,6 +49,7 @@ Commands:
stop Stop a running container
start Start a stopped container
restart Restart a running container
logs See the logs of a container
rm Remove a container
rmi Remove an image
Expand Down
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ program
}
});

program
.command('restart')
.description('Restart a running container')
.action(() => {
if (typeof process.argv[3] === 'undefined') {
const question = 'Which container would you like to restart?';
const error = 'supdock: no containers available to restart';
exec.executeCommand('ps', question, 'restart', error);
} else {
exec.docker();
}
});

program
.command('logs')
.description('See the logs of a container')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supdock",
"version": "0.2.4",
"version": "0.2.5",
"description": "What's Up Dock(er)?",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 258fb6b

Please sign in to comment.