Skip to content

Commit

Permalink
Merge pull request #265 from bravetools/build-config
Browse files Browse the repository at this point in the history
accept Bravefile directly into brave build
  • Loading branch information
idroz committed Mar 12, 2024
2 parents 2afb90b + a758c72 commit b9508d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions commands/build.go
Expand Up @@ -22,18 +22,20 @@ func init() {
}

func includePathFlags(cmd *cobra.Command) {
cmd.Flags().StringVarP(&remoteName, "remote", "r", "local", "Name of a Bravetools remote that will build the image.")
cmd.Flags().StringVarP(&bravefilePath, "path", "p", "", "Absolute path to Bravefile [OPTIONAL]")
cmd.Flags().StringVarP(&unitConfig, "config", "", "", "Path to the Bravefile file [OPTIONAL]")
cmd.Flags().StringVarP(&remoteName, "remote", "r", "local", "Name of a Bravetools remote that will build the image")
cmd.Flags().StringVarP(&bravefilePath, "path", "p", "", "Absolute path to directory containing the Bravefile [OPTIONAL]")
}

func build(cmd *cobra.Command, args []string) {
var p string
p := "Bravefile"

if bravefilePath == "" {
p = "Bravefile"
} else {
if bravefilePath != "" {
p = path.Join(bravefilePath, "Bravefile")
}
if unitConfig != "" {
p = unitConfig
}

err := bravefile.Load(p)

Expand Down

0 comments on commit b9508d8

Please sign in to comment.