Skip to content

Commit

Permalink
Fixing wego add --dry-run (weaveworks#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbafilho authored Jun 28, 2021
1 parent 5d542ea commit 4f1aa2d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmd/wego/add/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ var Cmd = &cobra.Command{
Long: strings.TrimSpace(dedent.Dedent(`
Associates an additional application in a git repository with a wego cluster so that its contents may be managed via GitOps
`)),
Example: "wego app add .",
RunE: runCmd,
Example: "wego app add .",
RunE: runCmd,
SilenceUsage: true,
SilenceErrors: true,
PostRun: func(cmd *cobra.Command, args []string) {
version.CheckVersion(version.CheckpointParamsWithFlags(version.CheckpointParams(), cmd))
},
Expand Down Expand Up @@ -86,7 +88,12 @@ func runCmd(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return fmt.Errorf("no app --url or app location specified")
} else {
params.Dir = args[0]
path, err := filepath.Abs(args[0])
if err != nil {
return fmt.Errorf("failed to get absolute path for the repo directory")
}

params.Dir = path
}
}

Expand Down

0 comments on commit 4f1aa2d

Please sign in to comment.