MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / ConvertFilePath

Method ConvertFilePath

cli/pkg/common/sshremote.go:333–348  ·  view source on GitHub ↗

转换文件路径为远程主机支持的

(filepath string)

Source from the content-addressed store, hash-verified

331
332// 转换文件路径为远程主机支持的
333func (instance *SSHRemote) ConvertFilePath(filepath string) (newFilepath string) {
334 newFilepath = filepath
335
336 newFilepath = strings.ReplaceAll(filepath, "\\", "/")
337
338 index := strings.Index(newFilepath, "~/")
339 if index == 0 {
340 pwd, err := instance.GetRemotePwd()
341 CheckError(err)
342 newFilepath = path.Join(pwd, strings.Replace(newFilepath, "~/", "", -1))
343 } else {
344 newFilepath = strings.ReplaceAll(newFilepath, "~/", "")
345 }
346
347 return newFilepath
348}
349
350// 检测远程服务器的环境,是否安装docker、docker-compose、git
351func (instance *SSHRemote) CheckRemoteEnv() error {

Callers 10

IsFileExistMethod · 0.95
IsDirExistMethod · 0.95
IsDirEmptyMethod · 0.95
ClearMethod · 0.95
RemoveMethod · 0.95
CopyDirectoryMethod · 0.95
GetContentMethod · 0.95
CreateFileByEchoMethod · 0.95
CheckAndCreateDirMethod · 0.95

Calls 3

GetRemotePwdMethod · 0.95
CheckErrorFunction · 0.85
JoinMethod · 0.45

Tested by

no test coverage detected