Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Commit

Permalink
add comment about tildes in expandPath
Browse files Browse the repository at this point in the history
  • Loading branch information
deansheather committed Jun 27, 2019
1 parent 3794755 commit dbf7a48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sshcode.go
Expand Up @@ -195,7 +195,8 @@ func sshCode(host, dir string, o options) error {
func expandPath(path string) string {
path = filepath.Clean(os.ExpandEnv(path))

// Replace tilde notation in path with the home directory.
// Replace tilde notation in path with the home directory. You can't replace the first instance of `~` in the
// string with the homedir as having a tilde in the middle of a filename is valid.
homedir := os.Getenv("HOME")
if homedir != "" {
if path == "~" {
Expand Down

0 comments on commit dbf7a48

Please sign in to comment.