File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
- 0.1.4
1
+ 0.1.5
Original file line number Diff line number Diff line change @@ -171,6 +171,13 @@ func dockerExec(ctx *cli.Context) {
171
171
execCmd := "docker exec -ti " + lastContainerID
172
172
execCmd += " " + shellCmd
173
173
174
+ result := getTerminalCmdOut ("docker" , "ps -f id=" + lastContainerID )
175
+ if ! strings .Contains (result , lastContainerID ) {
176
+ fmt .Println ("Last container " + lastContainerID + " is not running." )
177
+ fmt .Println ("Start container ..." )
178
+ getTerminalCmdOut ("docker" , "start " + lastContainerID )
179
+ }
180
+
174
181
runTerminalCmdInShell (execCmd )
175
182
}
176
183
@@ -437,12 +444,12 @@ func main() {
437
444
},
438
445
{
439
446
Name : "exec" ,
440
- Aliases : []string {"r " },
447
+ Aliases : []string {"e " },
441
448
Usage : "Executing the docker container" ,
442
449
Flags : []cli.Flag {
443
450
& cli.StringFlag {
444
451
Name : "shell" ,
445
- Aliases : []string {"s " },
452
+ Aliases : []string {"e " },
446
453
Usage : "Shell type to run (bash, zsh)" ,
447
454
Value : "zsh" ,
448
455
DefaultText : "zsh" ,
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ elif [ "$1" = "uninstall" ]; then
52
52
exit 0
53
53
fi
54
54
else
55
- echo " Wrong command $0 "
55
+ echo " Wrong command $1 "
56
56
echo " Please use install.sh install or install.sh uninstall"
57
57
exit 1
58
58
fi
You can’t perform that action at this time.
0 commit comments