From 1d48812b34ed283000d3802ae9225436ed917216 Mon Sep 17 00:00:00 2001 From: Andrew Pennebaker Date: Fri, 9 Mar 2018 20:17:43 -0600 Subject: [PATCH] fix later commands overwriting earlier commands --- .../common/step_type_boot_command.go | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/builder/virtualbox/common/step_type_boot_command.go b/builder/virtualbox/common/step_type_boot_command.go index cb5b43648..d54c5560a 100644 --- a/builder/virtualbox/common/step_type_boot_command.go +++ b/builder/virtualbox/common/step_type_boot_command.go @@ -182,92 +182,92 @@ func scancodes(message string) []string { var scancode []string if strings.HasPrefix(message, "") { - scancode = []string{"38"} + scancode = append(scancode, "38") message = message[len(""):] log.Printf("Special code '' found, replacing with: 38") } if strings.HasPrefix(message, "") { - scancode = []string{"1d"} + scancode = append(scancode, "1d") message = message[len(""):] log.Printf("Special code '' found, replacing with: 1d") } if strings.HasPrefix(message, "") { - scancode = []string{"2a"} + scancode = append(scancode, "2a") message = message[len(""):] log.Printf("Special code '' found, replacing with: 2a") } if strings.HasPrefix(message, "") { - scancode = []string{"b8"} + scancode = append(scancode, "b8") message = message[len(""):] log.Printf("Special code '' found, replacing with: b8") } if strings.HasPrefix(message, "") { - scancode = []string{"9d"} + scancode = append(scancode, "9d") message = message[len(""):] log.Printf("Special code '' found, replacing with: 9d") } if strings.HasPrefix(message, "") { - scancode = []string{"aa"} + scancode = append(scancode, "aa") message = message[len(""):] log.Printf("Special code '' found, replacing with: aa") } if strings.HasPrefix(message, "") { - scancode = []string{"e038"} + scancode = append(scancode, "e038") message = message[len(""):] log.Printf("Special code '' found, replacing with: e038") } if strings.HasPrefix(message, "") { - scancode = []string{"e01d"} + scancode = append(scancode, "e01d") message = message[len(""):] log.Printf("Special code '' found, replacing with: e01d") } if strings.HasPrefix(message, "") { - scancode = []string{"36"} + scancode = append(scancode, "36") message = message[len(""):] log.Printf("Special code '' found, replacing with: 36") } if strings.HasPrefix(message, "") { - scancode = []string{"e0b8"} + scancode = append(scancode, "e0b8") message = message[len(""):] log.Printf("Special code '' found, replacing with: e0b8") } if strings.HasPrefix(message, "") { - scancode = []string{"e09d"} + scancode = append(scancode, "e09d") message = message[len(""):] log.Printf("Special code '' found, replacing with: e09d") } if strings.HasPrefix(message, "") { - scancode = []string{"b6"} + scancode = append(scancode, "b6") message = message[len(""):] log.Printf("Special code '' found, replacing with: b6") } if strings.HasPrefix(message, "") { log.Printf("Special code found, will sleep 1 second at this point.") - scancode = []string{"wait"} + scancode = append(scancode, "wait") message = message[len(""):] } if strings.HasPrefix(message, "") { log.Printf("Special code found, will sleep 5 seconds at this point.") - scancode = []string{"wait5"} + scancode = append(scancode, "wait5") message = message[len(""):] } if strings.HasPrefix(message, "") { log.Printf("Special code found, will sleep 10 seconds at this point.") - scancode = []string{"wait10"} + scancode = append(scancode, "wait10") message = message[len(""):] } @@ -275,7 +275,7 @@ func scancodes(message string) []string { for specialCode, specialValue := range special { if strings.HasPrefix(message, specialCode) { log.Printf("Special code '%s' found, replacing with: %s", specialCode, specialValue) - scancode = specialValue + scancode = append(scancode, specialValue...) message = message[len(specialCode):] break }