forked from security/hakurei
internal/pkg: create work directory
This is used for artifacts that cure into directories. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -78,6 +78,10 @@ const (
|
||||
// dirChecksum is the directory name appended to Cache.base for storing
|
||||
// artifacts named after their [Checksum].
|
||||
dirChecksum = "checksum"
|
||||
|
||||
// dirWork is the directory name appended to Cache.base for working
|
||||
// directories created for [Cache.Store].
|
||||
dirWork = "work"
|
||||
)
|
||||
|
||||
// Cache is a support layer that implementations of [Artifact] can use to store
|
||||
@@ -235,6 +239,7 @@ func New(base *check.Absolute) (*Cache, error) {
|
||||
for _, name := range []string{
|
||||
dirIdentifier,
|
||||
dirChecksum,
|
||||
dirWork,
|
||||
} {
|
||||
if err := os.MkdirAll(base.Append(name).String(), 0700); err != nil &&
|
||||
!errors.Is(err, os.ErrExist) {
|
||||
|
||||
Reference in New Issue
Block a user