diff --git a/pkg/batchssh/fetch.go b/pkg/batchssh/fetch.go index 1de1321..bcb9b1e 100644 --- a/pkg/batchssh/fetch.go +++ b/pkg/batchssh/fetch.go @@ -6,7 +6,6 @@ import ( "os" "path" "path/filepath" - "strings" "github.com/pkg/sftp" @@ -66,11 +65,6 @@ func fetchFile( ftpC *sftp.Client, srcFile, dstDir, host string, ) error { - homeDir := os.Getenv("HOME") - if strings.HasPrefix(srcFile, "~/") { - srcFile = strings.Replace(srcFile, "~", homeDir, 1) - } - remoteFile, err := ftpC.Open(srcFile) if err != nil { if errors.Is(err, os.ErrNotExist) { diff --git a/pkg/batchssh/fetch_zip.go b/pkg/batchssh/fetch_zip.go index 0daa383..7b9d5bd 100644 --- a/pkg/batchssh/fetch_zip.go +++ b/pkg/batchssh/fetch_zip.go @@ -6,7 +6,6 @@ import ( "os" "path" "path/filepath" - "strings" "time" "github.com/pkg/sftp" @@ -106,11 +105,6 @@ func fetchZipFile( ftpC *sftp.Client, srcZipFile, dstDir string, ) error { - homeDir := os.Getenv("HOME") - if strings.HasPrefix(dstDir, "~/") { - srcZipFile = strings.Replace(dstDir, "~", homeDir, 1) - } - srcZipFileName := filepath.Base(srcZipFile) dstZipFile := path.Join(dstDir, srcZipFileName)