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

Method GetContent

cli/pkg/common/sshremote.go:291–300  ·  view source on GitHub ↗

获取文件内容

(filepath string)

Source from the content-addressed store, hash-verified

289
290// 获取文件内容
291func (instance *SSHRemote) GetContent(filepath string) string {
292
293 filepath = instance.ConvertFilePath(filepath)
294
295 command := fmt.Sprintf(`cat "%v"`, filepath)
296 outContent, err := instance.ExeSSHCommand(command)
297 CheckError(err)
298
299 return outContent
300}
301
302// 创建文件,如果存在就附加内容
303func (sshRemote *SSHRemote) CreateFileByEcho(filepath string, content string) error {

Callers 3

Calls 3

ConvertFilePathMethod · 0.95
ExeSSHCommandMethod · 0.95
CheckErrorFunction · 0.85

Tested by

no test coverage detected