main: helpful error message for flash cmd without -target

This commit is contained in:
Ayke van Laethem
2018-09-29 22:39:44 +02:00
parent b6db84e916
commit 802350f8da
+4
View File
@@ -181,6 +181,10 @@ func Flash(pkgName, target, port string, printIR, dumpSSA, debug bool, printSize
}
return Compile(pkgName, ".hex", spec, printIR, dumpSSA, debug, printSizes, func(tmppath string) error {
if spec.Flasher == "" {
return errors.New("no flash command specified - did you miss a -target flag?")
}
// Create the command.
flashCmd := spec.Flasher
flashCmd = strings.Replace(flashCmd, "{hex}", tmppath, -1)