Skip to content

Commit

Permalink
runquiet
Browse files Browse the repository at this point in the history
  • Loading branch information
lingen committed Jan 12, 2023
1 parent 417ef97 commit 8c51585
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ssh/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,21 @@ func (c Cli) Run(shell string) (string, error) {
c.LastResult = string(buf)
return c.LastResult, err
}

// 不需要输出信息
func (c Cli) RunQuiet(shell string) error{
if c.Client == nil {
if _, err := c.Connect(); err != nil {
return err
}
}
session, err := c.Client.NewSession()
if err != nil {
return err
}
// 关闭会话
defer session.Close()
return nil
}
/*
切片本地文件上传到远程
Expand Down

0 comments on commit 8c51585

Please sign in to comment.