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

Commit dbf7a48

Browse files
committed
add comment about tildes in expandPath
1 parent 3794755 commit dbf7a48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sshcode.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ func sshCode(host, dir string, o options) error {
195195
func expandPath(path string) string {
196196
path = filepath.Clean(os.ExpandEnv(path))
197197

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

0 commit comments

Comments
 (0)