Skip to content

Commit

Permalink
Merge pull request #184 from AY2223S2-CS2103-W17-1/gwyneth-export-pro…
Browse files Browse the repository at this point in the history
…gress

Add uncommitted code in gwyneth-export-progress
  • Loading branch information
gwynethguo authored Apr 9, 2023
2 parents 6596b78 + 9294d07 commit 9c08188
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public CommandResult execute(Model model) throws CommandException {
this.filePath = "data";
}

Path parentDir = Paths.get(this.filePath).getParent();
Path parentDir = Paths.get(this.filePath).toAbsolutePath().getParent();

if (parentDir != null) {
try {
Files.createDirectories(parentDir);
Expand All @@ -74,7 +75,7 @@ public CommandResult execute(Model model) throws CommandException {
}

try {
model.exportProgress(studentToExport, String.valueOf(Paths.get(this.filePath, fileName)));
model.exportProgress(studentToExport, String.valueOf(Paths.get(this.filePath, fileName).toAbsolutePath()));
} catch (IOException e) {
throw new CommandException("Error!\n" + e.getMessage());
}
Expand Down

0 comments on commit 9c08188

Please sign in to comment.