hakurei: move container toplevel

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-07-02 21:23:55 +09:00
parent 255b77d91d
commit a1d98823f8
33 changed files with 144 additions and 142 deletions

26
executable.go Normal file
View File

@@ -0,0 +1,26 @@
package hakurei
import (
"log"
"os"
"sync"
)
var (
executable string
executableOnce sync.Once
)
func copyExecutable() {
if name, err := os.Executable(); err != nil {
msg.BeforeExit()
log.Fatalf("cannot read executable path: %v", err)
} else {
executable = name
}
}
func MustExecutable() string {
executableOnce.Do(copyExecutable)
return executable
}