From e99d7affb0c128fa82722f9b3d79c99b5e5918cd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 11 Aug 2025 02:52:32 +0900 Subject: container: use absolute for pathname This is simultaneously more efficient and less error-prone. This change caused minor API changes in multiple other packages. Signed-off-by: Ophestra --- hst/paths.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'hst/paths.go') diff --git a/hst/paths.go b/hst/paths.go index 31c14df2..7410d7a0 100644 --- a/hst/paths.go +++ b/hst/paths.go @@ -1,11 +1,15 @@ package hst +import "hakurei.app/container" + // Paths contains environment-dependent paths used by hakurei. type Paths struct { + // temporary directory returned by [os.TempDir] (usually `/tmp`) + TempDir *container.Absolute `json:"temp_dir"` // path to shared directory (usually `/tmp/hakurei.%d`) - SharePath string `json:"share_path"` + SharePath *container.Absolute `json:"share_path"` // XDG_RUNTIME_DIR value (usually `/run/user/%d`) - RuntimePath string `json:"runtime_path"` + RuntimePath *container.Absolute `json:"runtime_path"` // application runtime directory (usually `/run/user/%d/hakurei`) - RunDirPath string `json:"run_dir_path"` + RunDirPath *container.Absolute `json:"run_dir_path"` } -- cgit v1.3.1