mirror of
https://github.com/labring/sealos.git
synced 2026-10-24 11:53:32 +08:00
fix spelling mistakes
This commit is contained in:
@@ -2,11 +2,12 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wonderivan/logger"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/wonderivan/logger"
|
||||
)
|
||||
|
||||
const oneMBByte = 1024 * 1024
|
||||
@@ -32,8 +33,8 @@ func LoggerFileSize(filename string, size int) {
|
||||
}
|
||||
}
|
||||
|
||||
//RemoteFilExist is
|
||||
func IsFilExist(filepath string) bool {
|
||||
//RemoteFileExist is
|
||||
func IsFileExist(filepath string) bool {
|
||||
// if remote file is
|
||||
// ls -l | grep aa | wc -l
|
||||
fileName := path.Base(filepath) // aa
|
||||
@@ -44,7 +45,7 @@ func IsFilExist(filepath string) bool {
|
||||
count, err := strconv.Atoi(strings.TrimSpace(data))
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Error("[os][%s]RemoteFilExist:%s", filepath, err)
|
||||
logger.Error("[os][%s]RemoteFileExist:%s", filepath, err)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
|
||||
@@ -2,11 +2,12 @@ package sshutil
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wonderivan/logger"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/wonderivan/logger"
|
||||
)
|
||||
|
||||
const oneMBByte = 1024 * 1024
|
||||
@@ -32,8 +33,8 @@ func (ss *SSH) LoggerFileSize(host, filename string, size int) {
|
||||
}
|
||||
}
|
||||
|
||||
//RemoteFilExist is
|
||||
func (ss *SSH) IsFilExist(host, remoteFilePath string) bool {
|
||||
//RemoteFileExist is
|
||||
func (ss *SSH) IsFileExist(host, remoteFilePath string) bool {
|
||||
// if remote file is
|
||||
// ls -l | grep aa | wc -l
|
||||
remoteFileName := path.Base(remoteFilePath) // aa
|
||||
@@ -46,7 +47,7 @@ func (ss *SSH) IsFilExist(host, remoteFilePath string) bool {
|
||||
count, err := strconv.Atoi(strings.TrimSpace(data))
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Error("[ssh][%s]RemoteFilExist:%s", host, err)
|
||||
logger.Error("[ssh][%s]RemoteFileExist:%s", host, err)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user