chore(gonf): add a DECLARED promise status and make it the default instead of PROMISED
This commit is contained in:
parent
48f2e9a2cb
commit
00cb3a2488
6 changed files with 49 additions and 21 deletions
|
@ -45,7 +45,7 @@ func Directory(filename any) *FilePromise {
|
|||
filename: interfaceToTemplateValue(filename),
|
||||
fileType: DIRECTORY,
|
||||
permissions: nil,
|
||||
status: PROMISED,
|
||||
status: DECLARED,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ func File(filename any) *FilePromise {
|
|||
filename: interfaceToTemplateValue(filename),
|
||||
fileType: FILE,
|
||||
permissions: nil,
|
||||
status: PROMISED,
|
||||
status: DECLARED,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,10 @@ func (f *FilePromise) IfRepaired(p ...Promise) Promise {
|
|||
}
|
||||
|
||||
func (f *FilePromise) Promise() *FilePromise {
|
||||
files = append(files, f)
|
||||
if f.status == DECLARED {
|
||||
f.status = PROMISED
|
||||
files = append(files, f)
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue