Skip to content

Commit

Permalink
update verification of folders
Browse files Browse the repository at this point in the history
  • Loading branch information
RVRX committed Jun 18, 2021
1 parent be0ba1a commit e578357
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Main {
public static String inputPath = System.getProperty("user.dir") + File.separator + "input" + File.separator;

public static void main(String[] args) {
System.out.println("Welcome to GoIStreamToolRedux CLI!\ntype 'help' for more info\nAwaiting User input...");
System.out.println("Welcome to GoIStreamToolRedux CLI!\ntype 'help' for more info. Type 'verify' if first start.\nAwaiting User input...");
boolean live = true;
Scanner scanner = new Scanner(System.in);
while (live) {
Expand Down Expand Up @@ -190,6 +190,30 @@ private static boolean verifyFolders() {
}
} else System.out.println("Output folder found");

//check map_images folder
Path map_imagesPathObject = Paths.get(inputPath + "map_images");
if (!Files.exists(outputPathObject)) {
System.out.println("map_images folder cannot be found... recreating");
if (outputPathObject.toFile().mkdirs()) {
System.out.println("map_images folder created successfully");
} else {
System.err.println("Error when creating map_images directory!");
status = false;
}
} else System.out.println("map_images folder found");

//check team_logos folder
Path team_logosPathObject = Paths.get(inputPath + "team_logos");
if (!Files.exists(outputPathObject)) {
System.out.println("team_logos folder cannot be found... recreating");
if (outputPathObject.toFile().mkdirs()) {
System.out.println("team_logos folder created successfully");
} else {
System.err.println("Error when creating team_logos directory!");
status = false;
}
} else System.out.println("team_logos folder found");

return status;
}

Expand Down

0 comments on commit e578357

Please sign in to comment.