Skip to content

Commit

Permalink
fix(cli): use relative paths (#2349)
Browse files Browse the repository at this point in the history
convert home to absolute path if it's relative

fixes: #1841
  • Loading branch information
ttarsi authored Nov 1, 2024
1 parent ac1f411 commit 1facb71
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/cmd/initnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1facb71

Please sign in to comment.