获取远程uid,gid
()
| 145 | |
| 146 | // 获取远程uid,gid |
| 147 | func (sshRemote *SSHRemote) GetRemoteUserInfo() (Uid string, Gid string) { |
| 148 | remuid, err := sshRemote.ExeSSHCommand("id -u $USER") |
| 149 | remgid, remgiderr := sshRemote.ExeSSHCommand("id -g $USER") |
| 150 | SmartIDELog.Debug("Remote---Uid:" + remuid) |
| 151 | SmartIDELog.Debug("Remote---Gid:" + remgid) |
| 152 | |
| 153 | if remuid != "" && err == nil { |
| 154 | Uid = remuid |
| 155 | } else { |
| 156 | Uid = "1000" |
| 157 | } |
| 158 | if remgid != "" && remgiderr == nil { |
| 159 | Gid = remgid |
| 160 | } else { |
| 161 | Gid = "1000" |
| 162 | } |
| 163 | return Uid, Gid |
| 164 | } |
| 165 | |
| 166 | // 当前目录是否已经clone |
| 167 | func (instance *SSHRemote) IsCloned(workSpaceDir string) bool { |
no test coverage detected