From be0e387ab07c7d9f1441365a05c4c0141779184a Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 13 Nov 2025 07:29:46 +0900 Subject: internal/info: relocate from internal This is cleaner and makes more sense. The longer LDFLAGS was never a valid concern since it is always inserted by a script. Signed-off-by: Ophestra --- cmd/hakurei/command.go | 4 ++-- cmd/hakurei/print.go | 20 ++++++++++---------- cmd/hpkg/proc.go | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'cmd') diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index 94fe7ead..2b0568e2 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -17,8 +17,8 @@ import ( "hakurei.app/container/check" "hakurei.app/container/fhs" "hakurei.app/hst" - "hakurei.app/internal" "hakurei.app/internal/env" + "hakurei.app/internal/info" "hakurei.app/internal/outcome" "hakurei.app/internal/system/dbus" "hakurei.app/message" @@ -353,7 +353,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr }).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id") } - c.Command("version", "Display version information", func(args []string) error { fmt.Println(internal.Version()); return errSuccess }) + c.Command("version", "Display version information", func(args []string) error { fmt.Println(info.Version()); return errSuccess }) c.Command("license", "Show full license text", func(args []string) error { fmt.Println(license); return errSuccess }) c.Command("template", "Produce a config template", func(args []string) error { encodeJSON(log.Fatal, os.Stdout, false, hst.Template()); return errSuccess }) c.Command("help", "Show this help message", func([]string) error { c.PrintHelp(); return errSuccess }) diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index 51358585..62131dbe 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -12,8 +12,8 @@ import ( "time" "hakurei.app/hst" - "hakurei.app/internal" "hakurei.app/internal/env" + "hakurei.app/internal/info" "hakurei.app/internal/outcome" "hakurei.app/internal/store" "hakurei.app/message" @@ -24,20 +24,20 @@ func printShowSystem(output io.Writer, short, flagJSON bool) { t := newPrinter(output) defer t.MustFlush() - info := &hst.Info{Version: internal.Version(), User: new(outcome.Hsu).MustID(nil)} - env.CopyPaths().Copy(&info.Paths, info.User) + hi := &hst.Info{Version: info.Version(), User: new(outcome.Hsu).MustID(nil)} + env.CopyPaths().Copy(&hi.Paths, hi.User) if flagJSON { - encodeJSON(log.Fatal, output, short, info) + encodeJSON(log.Fatal, output, short, hi) return } - t.Printf("Version:\t%s\n", info.Version) - t.Printf("User:\t%d\n", info.User) - t.Printf("TempDir:\t%s\n", info.TempDir) - t.Printf("SharePath:\t%s\n", info.SharePath) - t.Printf("RuntimePath:\t%s\n", info.RuntimePath) - t.Printf("RunDirPath:\t%s\n", info.RunDirPath) + t.Printf("Version:\t%s\n", hi.Version) + t.Printf("User:\t%d\n", hi.User) + t.Printf("TempDir:\t%s\n", hi.TempDir) + t.Printf("SharePath:\t%s\n", hi.SharePath) + t.Printf("RuntimePath:\t%s\n", hi.RuntimePath) + t.Printf("RunDirPath:\t%s\n", hi.RunDirPath) } // printShowInstance writes a representation of [hst.State] or [hst.Config] to output. diff --git a/cmd/hpkg/proc.go b/cmd/hpkg/proc.go index 013e0b69..aca2db42 100644 --- a/cmd/hpkg/proc.go +++ b/cmd/hpkg/proc.go @@ -10,11 +10,11 @@ import ( "os/exec" "hakurei.app/hst" - "hakurei.app/internal" + "hakurei.app/internal/info" "hakurei.app/message" ) -var hakureiPathVal = internal.MustHakureiPath().String() +var hakureiPathVal = info.MustHakureiPath().String() func mustRunApp(ctx context.Context, msg message.Msg, config *hst.Config, beforeFail func()) { var ( -- cgit v1.3.1