fix: SSH工具远程复制文件夹创建
This commit is contained in:
@@ -135,10 +135,10 @@ func (s *SSHClientSFTP) CopyFileLocalToRemote(localPath, remotePath string) erro
|
||||
defer localFile.Close()
|
||||
|
||||
// 创建远程目录
|
||||
// if err := s.Client.MkdirAll(filepath.Dir(remotePath)); err != nil {
|
||||
// logger.Errorf("CopyFileLocalToRemote failed to creating remote directory %s: => %s", remotePath, err.Error())
|
||||
// return err
|
||||
// }
|
||||
if err := s.Client.MkdirAll(filepath.Dir(remotePath)); err != nil {
|
||||
logger.Errorf("CopyFileLocalToRemote failed to creating remote directory %s: => %s", remotePath, err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
// 创建远程文件
|
||||
remoteFile, err := s.Client.Create(remotePath)
|
||||
|
||||
Reference in New Issue
Block a user