mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
Add a cross process build lock and use it in the archetype content builder
Fixes #9048
This commit is contained in:
parent
c7957c90e8
commit
ba35e69856
7 changed files with 79 additions and 32 deletions
|
@ -25,6 +25,18 @@ import (
|
|||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
// IsTest reports whether we're running as a test.
|
||||
var IsTest bool
|
||||
|
||||
func init() {
|
||||
for _, arg := range os.Args {
|
||||
if strings.HasPrefix(arg, "-test.") {
|
||||
IsTest = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateTempDir creates a temp dir in the given filesystem and
|
||||
// returns the dirnam and a func that removes it when done.
|
||||
func CreateTempDir(fs afero.Fs, prefix string) (string, func(), error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue