Skip to content

Commit

Permalink
rewite path check to lock only once
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastiaanKlippert committed Nov 5, 2018
1 parent f959b70 commit e692bbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ testfiles/*.pdf
*.pdf
.idea/
*.exe
wkhtmltopdf.exe.12.4
5 changes: 3 additions & 2 deletions wkhtmltopdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ func (pdfg *PDFGenerator) WriteFile(filename string) error {
//a running program once it has been found
func (pdfg *PDFGenerator) findPath() error {
const exe = "wkhtmltopdf"
if GetPath() != "" {
pdfg.binPath = GetPath()
pdfg.binPath = GetPath()
if pdfg.binPath != "" {
// wkhtmltopdf has already already found, return
return nil
}
exeDir, err := filepath.Abs(filepath.Dir(os.Args[0]))
Expand Down

0 comments on commit e692bbf

Please sign in to comment.