aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/path.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-06-25 20:44:49 +0900
committerOphestra <cat@gensokyo.uk>2025-06-25 20:50:24 +0900
commitaa454b158f3713b2ee47162837dcea1efdce0ee6 (patch)
tree71c9ebf64bf518311fccef1b9c0fc25d59778c26 /internal/path.go
parent7007bd6a1c022dee1951413b820a54f5b4271bbb (diff)
cmd/planterette: remove hsu special case
Remove special case and invoke hakurei out of process. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/path.go')
-rw-r--r--internal/path.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/path.go b/internal/path.go
index 9a59ac5b..6b7b2200 100644
--- a/internal/path.go
+++ b/internal/path.go
@@ -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) }