Return a friendlier error for empty executables
This commit is contained in:
parent
e1d5cc843f
commit
b3058e9894
|
@ -134,6 +134,9 @@ func validate() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exec check
|
// 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)
|
stat, err := os.Stat(createOpts.Exec)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return fmt.Errorf("Could not find executable: %s is not a file", createOpts.Exec)
|
return fmt.Errorf("Could not find executable: %s is not a file", createOpts.Exec)
|
||||||
|
|
Loading…
Reference in New Issue