From 8c814d711a3e200ad1c7ad49091683036a4d2fd2 Mon Sep 17 00:00:00 2001 From: "K@zuki" <2923219+corrupt952@users.noreply.github.com> Date: Sun, 7 Nov 2021 15:44:58 +0900 Subject: [PATCH] Set currentPath on profile init rootPath (#11) --- command/init.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/command/init.go b/command/init.go index abe52dd..427f52d 100644 --- a/command/init.go +++ b/command/init.go @@ -6,7 +6,6 @@ import ( "flag" "io/ioutil" "os" - "os/user" "text/template" "github.com/google/subcommands" @@ -79,7 +78,7 @@ command = "echo 'hello'"`) logger.Err(err.Error()) return subcommands.ExitFailure } - usr, err := user.Current() + currentPath, err := os.Getwd() if err != nil { logger.Err(err.Error()) return subcommands.ExitFailure @@ -88,7 +87,7 @@ command = "echo 'hello'"`) attach := true err = tmpl.Execute(&buf, &config.Config{ Name: cmd.profile, - Root: usr.HomeDir, + Root: currentPath, Attach: &attach, Windows: []config.Window{}, })