mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: fix mis-handling of start alias
For "ctrld start", os.Args length is just 2, so we we could not shorten it from 3.
This commit is contained in:
committed by
Cuong Manh Le
parent
114ef9aad6
commit
7b13fd862d
@@ -151,7 +151,11 @@ func initCLI() {
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg := &service.Config{}
|
||||
*cfg = *svcConfig
|
||||
cfg.Arguments = append([]string{"run"}, os.Args[3:]...)
|
||||
osArgs := os.Args[2:]
|
||||
if os.Args[1] == "service" {
|
||||
osArgs = os.Args[3:]
|
||||
}
|
||||
cfg.Arguments = append([]string{"run"}, osArgs...)
|
||||
if dir, err := os.UserHomeDir(); err == nil {
|
||||
// WorkingDirectory is not supported on Windows.
|
||||
cfg.WorkingDirectory = dir
|
||||
|
||||
Reference in New Issue
Block a user