forked from security/hakurei
cmd/planterette: remove hsu special case
Remove special case and invoke hakurei out of process. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -8,16 +8,26 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
hsu = compPoison
|
||||
hakurei = compPoison
|
||||
hsu = compPoison
|
||||
)
|
||||
|
||||
func MustHakureiPath() string {
|
||||
if name, ok := checkPath(hakurei); ok {
|
||||
return name
|
||||
}
|
||||
hlog.BeforeExit()
|
||||
log.Fatal("invalid hakurei path, this program is compiled incorrectly")
|
||||
return compPoison // unreachable
|
||||
}
|
||||
|
||||
func MustHsuPath() string {
|
||||
if name, ok := checkPath(hsu); ok {
|
||||
return name
|
||||
}
|
||||
hlog.BeforeExit()
|
||||
log.Fatal("invalid hsu path, this program is compiled incorrectly")
|
||||
return compPoison
|
||||
return compPoison // unreachable
|
||||
}
|
||||
|
||||
func checkPath(p string) (string, bool) { return p, p != compPoison && p != "" && path.IsAbs(p) }
|
||||
|
||||
Reference in New Issue
Block a user