From 802350f8dafebf9c8e674f92bc43816fc21f7081 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 29 Sep 2018 22:39:44 +0200 Subject: [PATCH] main: helpful error message for flash cmd without -target --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 9137bc3f..25b43d11 100644 --- a/main.go +++ b/main.go @@ -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)