From b3058e989410ee4eec89bd38e4fddec9ef87d158 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 13 Mar 2018 03:03:35 +0100 Subject: [PATCH] Return a friendlier error for empty executables --- createcmd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/createcmd.go b/createcmd.go index d050dfc..1116d8b 100644 --- a/createcmd.go +++ b/createcmd.go @@ -134,6 +134,9 @@ func validate() error { } // Exec check + if len(strings.TrimSpace(createOpts.Exec)) == 0 { + return fmt.Errorf("Need an executable to create a service for") + } stat, err := os.Stat(createOpts.Exec) if os.IsNotExist(err) { return fmt.Errorf("Could not find executable: %s is not a file", createOpts.Exec)