Skip to content

Commit

Permalink
adding throwing error when both buildpack and extension flags are spe…
Browse files Browse the repository at this point in the history
…cified
  • Loading branch information
pacostas committed Apr 26, 2023
1 parent ae19e61 commit b304e83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func pack() *cobra.Command {
cmd.Flags().BoolVar(&flags.offline, "offline", false, "enable offline caching of dependencies")
cmd.Flags().StringVar(&flags.stack, "stack", "", "restricts dependencies to given stack")

cmd.MarkFlagsMutuallyExclusive("buildpack", "extension")

err := cmd.MarkFlagRequired("output")
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to mark output flag as required")
Expand Down Expand Up @@ -66,7 +68,7 @@ func packRun(flags packFlags) error {
} else if flags.extensionTOMLPath != "" {
buildpackOrExtensionTOMLPath = flags.extensionTOMLPath
} else {
return fmt.Errorf("--buildpack or --extension flag is required")
return fmt.Errorf("\"buildpack\" or \"extension\" flag is required")
}

directoryDuplicator := cargo.NewDirectoryDuplicator()
Expand Down

0 comments on commit b304e83

Please sign in to comment.