From 7c3c3135d8b0eab767e58bd8ef0e7e04abee3ca2 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 2 Nov 2025 12:40:58 +0900 Subject: internal/outcome: track state in TMPDIR The SharePath is a more stable path than RunDirPath, since it is available all the time and should remain consistent. This also fits better into the intended use case of XDG_RUNTIME_DIR. Closes #17. Signed-off-by: Ophestra --- cmd/hakurei/command.go | 2 +- cmd/hakurei/parse.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index e71ac16a..18bc9cef 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -322,7 +322,7 @@ func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErr c.NewCommand("ps", "List active instances", func(args []string) error { var sc hst.Paths env.CopyPaths().Copy(&sc, new(outcome.Hsu).MustID(nil)) - printPs(os.Stdout, time.Now().UTC(), store.NewMulti(msg, sc.RunDirPath), flagShort, flagJSON) + printPs(os.Stdout, time.Now().UTC(), store.NewMulti(msg, sc.SharePath), flagShort, flagJSON) return errSuccess }).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id") } diff --git a/cmd/hakurei/parse.go b/cmd/hakurei/parse.go index 8aef8e98..51f2d5bd 100644 --- a/cmd/hakurei/parse.go +++ b/cmd/hakurei/parse.go @@ -85,7 +85,7 @@ func tryIdentifier(msg message.Msg, name string) (config *hst.Config, entry *hst return tryIdentifierEntries(msg, name, func() map[hst.ID]*hst.State { var sc hst.Paths env.CopyPaths().Copy(&sc, new(outcome.Hsu).MustID(nil)) - s := store.NewMulti(msg, sc.RunDirPath) + s := store.NewMulti(msg, sc.SharePath) if entries, err := store.Join(s); err != nil { msg.GetLogger().Printf("cannot join store: %v", err) // not fatal return nil -- cgit v1.3.1