|
|
|
|
@ -29,6 +29,9 @@ type Config struct {
|
|
|
|
|
// The shebang value used when running inline scripts.
|
|
|
|
|
InlineShebang string `mapstructure:"inline_shebang"`
|
|
|
|
|
|
|
|
|
|
// An array of multiple Runtime OSs to run on.
|
|
|
|
|
OnlyOn []string `mapstructure:"only_on"`
|
|
|
|
|
|
|
|
|
|
// The file extension to use for the file generated from the inline commands
|
|
|
|
|
TempfileExtension string `mapstructure:"tempfile_extension"`
|
|
|
|
|
|
|
|
|
|
@ -159,6 +162,25 @@ func Validate(config *Config) error {
|
|
|
|
|
fmt.Errorf("Bad script '%s': %s", path, err))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check for properly formatted go os types
|
|
|
|
|
supported_syslist := []string{"darwin", "freebsd", "linux", "openbsd", "solaris", "windows"}
|
|
|
|
|
if len(config.OnlyOn) > 0 {
|
|
|
|
|
for _, provided_os := range config.OnlyOn {
|
|
|
|
|
supported_os := false
|
|
|
|
|
for _, go_os := range supported_syslist {
|
|
|
|
|
if provided_os == go_os {
|
|
|
|
|
supported_os = true
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if supported_os != true {
|
|
|
|
|
return fmt.Errorf("Invalid OS specified in only_on: '%s'\n"+
|
|
|
|
|
"Supported OS names: %s", provided_os, strings.Join(supported_syslist, ", "))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if config.UseLinuxPathing {
|
|
|
|
|
for index, script := range config.Scripts {
|
|
|
|
|
scriptAbsPath, err := filepath.Abs(script)
|
|
|
|
|
|