forked from rosa/hakurei
internal/rosa: expose in-place behaviour in generic helper
This change also combines the createDir and wantsDir methods, and replaces the non-inplace target of the generic helper with a deterministic path. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -82,15 +82,12 @@ func (attr *MakeHelper) scriptEarly() string {
|
||||
return generate
|
||||
}
|
||||
|
||||
// createDir returns false.
|
||||
func (*MakeHelper) createDir() bool { return false }
|
||||
|
||||
// wantsDir requests a new directory in TMPDIR, or omits the cd statement if InPlace.
|
||||
func (attr *MakeHelper) wantsDir() string {
|
||||
func (attr *MakeHelper) wantsDir() (string, bool) {
|
||||
if attr != nil && attr.InPlace {
|
||||
return helperInPlace
|
||||
return helperInPlace, false
|
||||
}
|
||||
return `"$(mktemp -d)"`
|
||||
return `"$(mktemp -d)"`, false
|
||||
}
|
||||
|
||||
// script generates the cure script.
|
||||
|
||||
Reference in New Issue
Block a user