Ensure that DirFilePaths exists in Process()
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
+ "os"
"runtime"
"runtime/debug"
"sort"
@@ -309,6 +310,11 @@ func Process() {
DirFilePaths = append(DirFilePaths, ".")
}
+ if _, err := os.Stat(DirFilePaths[0]); os.IsNotExist(err) {
+ fmt.Println("file or directory does not exists: " + DirFilePaths[0])
+ return
+ }
+
SortBy = strings.ToLower(SortBy)
if Debug {
