File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,19 @@ func ExtractBuildInfo(ctx context.Context) *BuildInfo {
77
77
}
78
78
79
79
func ExtractEnv (ctx context.Context , envKey string ) string {
80
+ meta := extractMeta (ctx )
81
+ if value , exist := meta .OverrideEnv [envKey ]; exist {
82
+ return value
83
+ }
84
+
80
85
if envKey == "HOME" {
81
86
homeDir , _ := os .UserHomeDir ()
82
87
return homeDir
83
88
}
84
89
85
- meta := extractMeta (ctx )
86
- if value , exist := meta .OverrideEnv [envKey ]; exist {
87
- return value
88
- }
89
90
return os .Getenv (envKey )
90
91
}
92
+
93
+ func ExtractUserHomeDir (ctx context.Context ) string {
94
+ return ExtractEnv (ctx , "HOME" )
95
+ }
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func initCommand() *core.Command {
49
49
func InitRun (ctx context.Context , argsI interface {}) (i interface {}, e error ) {
50
50
// Get default local SSH key
51
51
relativePath := path .Join (".ssh" , "id_rsa.pub" )
52
- filename := path .Join (core .ExtractEnv (ctx , "HOME" ), relativePath )
52
+ filename := path .Join (core .ExtractUserHomeDir (ctx ), relativePath )
53
53
shortenedFilename := "~/" + relativePath
54
54
localSSHKeyContent , err := ioutil .ReadFile (filename )
55
55
You can’t perform that action at this time.
0 commit comments