Skip to content

Commit

Permalink
feat: add CLI flag to entirely skip LFS
Browse files Browse the repository at this point in the history
  • Loading branch information
zachahn-gusto committed Nov 25, 2024
1 parent 81a84e7 commit 18d7a9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ func (run) New(opts *lefthook.Options) *cobra.Command {
"skip updating git hooks",
)

runCmd.Flags().BoolVar(
&runArgs.NoLFS, "no-lfs", false,
"skip running git lfs",
)

runCmd.Flags().BoolVar(
&runArgs.FilesFromStdin, "files-from-stdin", false,
"get files from standard input, null-separated",
Expand Down
3 changes: 2 additions & 1 deletion internal/lefthook/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type RunArgs struct {
FilesFromStdin bool
Force bool
NoAutoInstall bool
NoLFS bool
Files []string
RunOnlyCommands []string
}
Expand Down Expand Up @@ -162,7 +163,7 @@ func (l *Lefthook) Run(hookName string, args RunArgs, gitArgs []string) error {
GitArgs: gitArgs,
LogSettings: logSettings,
DisableTTY: cfg.NoTTY || args.NoTTY,
DisableLFS: cfg.SkipLFS,
DisableLFS: cfg.SkipLFS || args.NoLFS,
Files: args.Files,
Force: args.Force,
RunOnlyCommands: args.RunOnlyCommands,
Expand Down

0 comments on commit 18d7a9e

Please sign in to comment.