Skip to content

Commit

Permalink
fix: make tags optional
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Dec 6, 2024
1 parent 145ac90 commit 0a0d189
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ packages:
`

// NewInit represents the init command
func NewInit(root *cobra.Command) *cobra.Command {
func NewInit(root *cobra.Command) {
cmd := &cobra.Command{
Use: "init",
Short: "Init ownbrew",
Expand All @@ -54,6 +54,4 @@ func NewInit(root *cobra.Command) *cobra.Command {
}

root.AddCommand(cmd)

return cmd
}
6 changes: 2 additions & 4 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// NewInstall represents the install command
func NewInstall(root *cobra.Command) *cobra.Command {
func NewInstall(root *cobra.Command) {
cmd := &cobra.Command{
Use: "install",
Short: "Install dependencies",
Expand Down Expand Up @@ -50,9 +50,7 @@ func NewInstall(root *cobra.Command) *cobra.Command {
}

cmd.Flags().Bool("dry", false, "print out the taps that will be installed")
cmd.Flags().StringSlice("tags", nil, "filter by tags (e.g. ci,-test")
cmd.Flags().StringSlice("tags", nil, "filter by tags (e.g. ci,-test)")

root.AddCommand(cmd)

return cmd
}
3 changes: 1 addition & 2 deletions ownbrew.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
"type": "object",
"required": [
"tap",
"version",
"tags"
"version"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func InitConfig() {
viper.SetConfigFile(filename)
return
}
// Search config in home directory with name ".sesamy" (without extension).
// Search config in home directory with name ".ownbrew" (without extension).
viper.AddConfigPath(".")
viper.SetConfigName("ownbrew")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Package struct {
// Version of the package to install
Version string `json:"version" yaml:"version"`
// List of tags
Tags []string `json:"tags" yaml:"tags"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

func (c Package) AllNames() []string {
Expand Down

0 comments on commit 0a0d189

Please sign in to comment.