feat(cli): improve error handling for missing plugin dir
This commit is contained in:
@@ -28,7 +28,15 @@ func validateInput(c CommandLine, pluginFolder string) error {
|
||||
}
|
||||
|
||||
fileInfo, err := os.Stat(pluginDir)
|
||||
if err != nil && !fileInfo.IsDir() {
|
||||
if err != nil {
|
||||
if err = os.MkdirAll(pluginDir, os.ModePerm); err != nil {
|
||||
return errors.New("path is not a directory")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
if !fileInfo.IsDir() {
|
||||
return errors.New("path is not a directory")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user