From 806ff9bad09e8bf253a1bdc379fbed2b1a56c5a7 Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Thu, 28 Mar 2024 09:00:00 +0800 Subject: [PATCH] home: imp code --- internal/home/home.go | 3 ++- internal/home/service.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/home/home.go b/internal/home/home.go index aab8eadb..8060467a 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -760,7 +760,8 @@ func writePIDFile(fn string) bool { } // initConfigFilename sets up context config file path. This file path can be -// overridden by command-line arguments, or is set to default. +// overridden by command-line arguments, or is set to default. Must only be +// called after initializing the workDir with initWorkingDir. func initConfigFilename(opts options) { confPath := opts.confFilename if confPath == "" { diff --git a/internal/home/service.go b/internal/home/service.go index 3e153f53..cb8f9b8b 100644 --- a/internal/home/service.go +++ b/internal/home/service.go @@ -274,6 +274,7 @@ func handleServiceCommand(s service.Service, action string, opts options) (err e if err = initWorkingDir(opts); err != nil { return fmt.Errorf("failed to init working dir: %w", err) } + initConfigFilename(opts) handleServiceInstallCommand(s)