Skip to content

Commit

Permalink
fix: quote script path (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Sep 23, 2024
1 parent 76cf1a0 commit 3daab42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/lefthook/runner/prepare_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"os"
"strings"

"gopkg.in/alessio/shellescape.v1"

"github.com/evilmartians/lefthook/internal/config"
"github.com/evilmartians/lefthook/internal/log"
)
Expand Down Expand Up @@ -36,7 +38,7 @@ func (r *Runner) prepareScript(script *config.Script, path string, file os.FileI
args = append(args, script.Runner)
}

args = append(args, path)
args = append(args, shellescape.Quote(path))
args = append(args, r.GitArgs...)

return strings.Join(args, " "), nil
Expand Down

0 comments on commit 3daab42

Please sign in to comment.