mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02: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:
+5
-1
@@ -151,7 +151,11 @@ func initCLI() {
|
|||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
cfg := &service.Config{}
|
cfg := &service.Config{}
|
||||||
*cfg = *svcConfig
|
*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 {
|
if dir, err := os.UserHomeDir(); err == nil {
|
||||||
// WorkingDirectory is not supported on Windows.
|
// WorkingDirectory is not supported on Windows.
|
||||||
cfg.WorkingDirectory = dir
|
cfg.WorkingDirectory = dir
|
||||||
|
|||||||
Reference in New Issue
Block a user