aboutsummaryrefslogtreecommitdiffhomepage
path: root/state.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-23 21:46:21 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-23 21:46:21 +0900
commit6bc5be7e5a2334274adf2945ad6d29d063a7086b (patch)
treed99223898a282b7ea40c41330b5748a3b5f2b310 /state.go
parente35c5fe3ed995d352c001bd7e35bd1214ca583da (diff)
internal: wrap calls to os standard library functions
This change helps tests stub out and simulate OS behaviour during the sealing process. This also removes dependency on XDG_RUNTIME_DIR as the internal.System implementation provided to App provides a compat directory inside the tmpdir-based share when XDG_RUNTIME_DIR is unavailable. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'state.go')
-rw-r--r--state.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/state.go b/state.go
index c4551ac3..40b550cb 100644
--- a/state.go
+++ b/state.go
@@ -3,10 +3,8 @@ package main
import (
"flag"
"fmt"
- "os"
"text/tabwriter"
- "git.ophivana.moe/security/fortify/internal"
"git.ophivana.moe/security/fortify/internal/fmsg"
"git.ophivana.moe/security/fortify/internal/state"
)
@@ -23,7 +21,7 @@ func init() {
func tryState() {
if stateActionEarly {
var w *tabwriter.Writer
- state.MustPrintLauncherStateSimpleGlobal(&w, internal.GetSC().RunDirPath)
+ state.MustPrintLauncherStateSimpleGlobal(&w, os.Paths().RunDirPath)
if w != nil {
if err := w.Flush(); err != nil {
fmsg.Println("cannot format output:", err)