Skip to content

Commit

Permalink
Fix args length bug on apply
Browse files Browse the repository at this point in the history
Signed-off-by: Liam White <[email protected]>
  • Loading branch information
liamawhite committed Jul 4, 2019
1 parent 6cad3c4 commit 5dd3fe3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/command/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ var applyCmd = &cobra.Command{
Short: "Apply licenses to files in your directory",

Args: func(cmd *cobra.Command, args []string) error {
if len(args) <= 1 {
if len(args) < 1 {
return errors.New("not enough arguments passed")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) {
license := license.NewApache20(time.Now().Year(), args[1])
license := license.NewApache20(time.Now().Year(), args[0])
l := processor.New(".", license)
if ok := l.Apply(recurseDirectories, isDryRun); !ok {
os.Exit(1)
Expand Down

0 comments on commit 5dd3fe3

Please sign in to comment.