Refactor SSHExternal flag so it isn't quietly ignored on Windows

This commit is contained in:
Oliver Bristow
2016-11-14 00:55:33 +00:00
parent 6d82ad32a9
commit f648b5ad0a
3 changed files with 12 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ package config
import (
"fmt"
"runtime"
"strings"
log "github.com/Sirupsen/logrus"
@@ -70,6 +71,10 @@ type Config struct {
func (c Config) Validate() bool {
errs := []error{}
if runtime.GOOS == "windows" && c.SSHExternal {
errs = append(errs, fmt.Errorf("-ssh-external cannot be used on windows"))
}
if len(c.ResultsDir) != 0 {
if ok, _ := valid.IsFilePath(c.ResultsDir); !ok {
errs = append(errs, fmt.Errorf(