Skip to content

Commit 4f1aa2d

Browse files
authored
Fixing wego add --dry-run (#391)
1 parent 5d542ea commit 4f1aa2d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cmd/wego/add/cmd.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ var Cmd = &cobra.Command{
3232
Long: strings.TrimSpace(dedent.Dedent(`
3333
Associates an additional application in a git repository with a wego cluster so that its contents may be managed via GitOps
3434
`)),
35-
Example: "wego app add .",
36-
RunE: runCmd,
35+
Example: "wego app add .",
36+
RunE: runCmd,
37+
SilenceUsage: true,
38+
SilenceErrors: true,
3739
PostRun: func(cmd *cobra.Command, args []string) {
3840
version.CheckVersion(version.CheckpointParamsWithFlags(version.CheckpointParams(), cmd))
3941
},
@@ -86,7 +88,12 @@ func runCmd(cmd *cobra.Command, args []string) error {
8688
if len(args) == 0 {
8789
return fmt.Errorf("no app --url or app location specified")
8890
} else {
89-
params.Dir = args[0]
91+
path, err := filepath.Abs(args[0])
92+
if err != nil {
93+
return fmt.Errorf("failed to get absolute path for the repo directory")
94+
}
95+
96+
params.Dir = path
9097
}
9198
}
9299

0 commit comments

Comments
 (0)