mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-29 13:26:38 -04:00
Implement error-specific exit codes
This commit is contained in:
+2
-2
@@ -25,12 +25,12 @@ func WalkEntryDir() ([]string, []string) {
|
||||
// check for errors encountered while walking directory
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
fmt.Println(core.AnsiError+"The entry directory does not exist - run \""+os.Args[0], "init"+"\" to create it"+core.AnsiReset)
|
||||
fmt.Println(core.AnsiError+"The entry directory does not exist - Run \""+os.Args[0], "init"+"\" to create it"+core.AnsiReset)
|
||||
} else {
|
||||
// otherwise, print the source of the error
|
||||
fmt.Println(core.AnsiError + "An unexpected error occurred while generating the entry list: " + err.Error() + core.AnsiReset)
|
||||
}
|
||||
os.Exit(1)
|
||||
os.Exit(111)
|
||||
}
|
||||
|
||||
// trim root path from each path before storing
|
||||
|
||||
Reference in New Issue
Block a user