Skip to content

Commit

Permalink
Level-7
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitcube committed Oct 5, 2023
1 parent 47c89fa commit 2840b04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions docs/dukey.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
1.[T][ ] kill akshay
2.[T][ ] kill minjun
3.[D][ ] kill (by: 9)
13 changes: 4 additions & 9 deletions src/main/java/Dukey.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,10 @@ public static void main(String[] args) throws IOException {
String file2 = "./docs/dukey.txt";
File file = new File(file2);
// Check if the file or directory exists, and create it if it doesn't
if (!file.exists()) {
try {
if (file.getParentFile() != null && !file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
file.createNewFile(); // Create the file
} catch (IOException e) {
System.out.println("Something went wrong: " + e.getMessage());
}
if (file.createNewFile()) {
System.out.println("File created");
} else {
System.out.println("File already exists");
}
try {
fileToTaskArray(file2, tasks);
Expand Down

0 comments on commit 2840b04

Please sign in to comment.