Skip to content

Commit

Permalink
Merge pull request #33 from frozenkp/master
Browse files Browse the repository at this point in the history
fix issue #32
  • Loading branch information
TimothyYe authored Apr 30, 2021
2 parents a151311 + 5584150 commit 32a03a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,8 @@ func loadSingleKey(keyPath string, env *Environment) *SSHKey {
key.PrivateKey = path

parsedPath := ParsePath(filepath.Join(env.SSHPath, kt.KeyBaseName))
absPath, err := filepath.Abs(filepath.Join(env.SSHPath, parsedPath))
if err != nil {
return nil
}

if path == absPath {
if path == parsedPath {
key.IsDefault = true
}

Expand Down Expand Up @@ -267,6 +263,10 @@ func ParsePath(path string) string {
os.Exit(1)
}

if !filepath.IsAbs(originFile) {
originFile = filepath.Join(filepath.Dir(path), originFile)
}

return originFile
}
return path
Expand Down

0 comments on commit 32a03a9

Please sign in to comment.