Skip to content

Commit

Permalink
refactor(fetch): delete useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
windvalley committed Jan 12, 2024
1 parent c5bef49 commit 0130e6d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions pkg/batchssh/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"path"
"path/filepath"
"strings"

"github.com/pkg/sftp"

Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions pkg/batchssh/fetch_zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"path"
"path/filepath"
"strings"
"time"

"github.com/pkg/sftp"
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 0130e6d

Please sign in to comment.