|
|
|
|
@ -29,21 +29,19 @@ type EnvVarsTemplate struct {
|
|
|
|
|
|
|
|
|
|
func Run(ui packer.Ui, config *Config) (bool, error) {
|
|
|
|
|
// Check if shell-local can even execute against this runtime OS
|
|
|
|
|
runCommand := false
|
|
|
|
|
if len(config.OnlyOn) > 0 {
|
|
|
|
|
runCommand := false
|
|
|
|
|
for _, os := range config.OnlyOn {
|
|
|
|
|
if os == runtime.GOOS {
|
|
|
|
|
runCommand = true
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
runCommand = true
|
|
|
|
|
}
|
|
|
|
|
if !runCommand {
|
|
|
|
|
ui.Say(fmt.Sprintf("Skipping shell-local due to runtime OS"))
|
|
|
|
|
log.Printf("[INFO] (shell-local): skipping shell-local due to missing runtime OS")
|
|
|
|
|
return true, nil
|
|
|
|
|
if !runCommand {
|
|
|
|
|
ui.Say(fmt.Sprintf("Skipping shell-local due to runtime OS"))
|
|
|
|
|
log.Printf("[INFO] (shell-local): skipping shell-local due to missing runtime OS")
|
|
|
|
|
return true, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scripts := make([]string, len(config.Scripts))
|
|
|
|
|
|