Merge pull request #257 from sthulb/ssh-keygen-fix

Adds check for SSH keygen command
This commit is contained in:
Evan Hazlett 2015-01-10 10:08:30 -08:00
commit e0cbae3461
1 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,10 @@ func GetSSHCommand(host string, port int, user string, sshKey string, args ...st
}
func GenerateSSHKey(path string) error {
if _, err := exec.LookPath("ssh-keygen"); err != nil {
return fmt.Errorf("ssh-keygen not found in the path, please install ssh-keygen")
}
if _, err := os.Stat(path); err != nil {
if !os.IsNotExist(err) {
return err