- dp = opendir ("./scripts/");
-
- if (dp != NULL)
- {
- while ((ep = readdir (dp)) != NULL)
- {
- if( str_ends_with(ep->d_name, ".lua"))
- PrintAndLog("%-16s %s", ep->d_name, "A script file");
- }
- (void) closedir (dp);
- }
- else
- PrintAndLog ("Couldn't open the scripts-directory");
+ DIR *dp = opendir ("./scripts/");
+ if ( dp == NULL ) {
+ PrintAndLog ("Couldn't open the scripts-directory");
+ return 1;
+ }
+
+ while ((ep = readdir (dp)) != NULL)
+ {
+ if(str_ends_with(ep->d_name, ".lua"))
+ PrintAndLog("%-21s %s", ep->d_name, "A script file");
+ }
+ (void) closedir (dp);