From 1facb71ed8bb4983be925b90e880381ea6a8125b Mon Sep 17 00:00:00 2001 From: ttarsi <31632172+ttarsi@users.noreply.github.com> Date: Fri, 1 Nov 2024 06:53:48 -0400 Subject: [PATCH] fix(cli): use relative paths (#2349) convert home to absolute path if it's relative fixes: #1841 --- cli/cmd/initnodes.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli/cmd/initnodes.go b/cli/cmd/initnodes.go index 49e6e308e..5408132f7 100644 --- a/cli/cmd/initnodes.go +++ b/cli/cmd/initnodes.go @@ -87,6 +87,14 @@ func InitNodes(ctx context.Context, cfg InitConfig) error { return errors.New("required flag --moniker not set") } + if !filepath.IsAbs(cfg.Home) { + absPath, err := filepath.Abs(cfg.Home) + if err != nil { + return errors.Wrap(err, "convert path") + } + cfg.Home = absPath + } + if cfg.Home == "" { var err error cfg.Home, err = homeDir(cfg.Network)