Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression from #314 (chmod missed fix) #330

Merged
merged 3 commits into from
Sep 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move quotedScriptPath initialization near actual use
Believe it or not, I'm NOT a C89 programmer, I hate code that initializes variables at the top of the block. And yet, here I am. *Something something cobblers kids have no shoes something*
  • Loading branch information
ariccio committed Sep 27, 2022
commit 4e2c42a357bef1956cb307862a5ead49b293ab28
2 changes: 1 addition & 1 deletion internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func (r *Runner) runScripts(dir string) {
}

func (r *Runner) runScript(script *config.Script, unquotedPath string, file os.FileInfo) {
quotedScriptPath := shellescape.Quote(unquotedPath)
if script.DoSkip(r.repo.State()) {
logSkip(file.Name(), "(SKIP BY SETTINGS)")
return
Expand Down Expand Up @@ -209,6 +208,7 @@ func (r *Runner) runScript(script *config.Script, unquotedPath string, file os.F
args = strings.Split(script.Runner, " ")
}

quotedScriptPath := shellescape.Quote(unquotedPath)
args = append(args, quotedScriptPath)
args = append(args, r.args[:]...)

Expand Down