获取文件内容
(filepath string)
| 289 | |
| 290 | // 获取文件内容 |
| 291 | func (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 | // 创建文件,如果存在就附加内容 |
| 303 | func (sshRemote *SSHRemote) CreateFileByEcho(filepath string, content string) error { |
no test coverage detected