Skip to content

Commit

Permalink
History: Change save method to include correct filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
WinstonJin committed Sep 19, 2024
1 parent 52c75af commit 6b1cb98
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/windebot/History.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class History {
private static final String WINDE_FILE = "./src/main/java/windebot/WindeTasks.txt";
private static final String WINDE_ALTERNATE_FILE =
"/Users/winston/Desktop/Code/CS2103/ip/src/main/java/windebot/Winde.java";
private static final String WINDE_ANOTHER_FILE = "../src/main/java/windebot/Winde.java";
"/Users/winston/Desktop/Code/CS2103/ip/src/main/java/windebot/WindeTasks.txt";
private static final String WINDE_ANOTHER_FILE = "WindeTasks.txt";

private static String filePath;

Expand Down Expand Up @@ -56,8 +56,6 @@ public static ArrayList<Task> load() {
ArrayList<Task> taskList = new ArrayList<Task>();
try {
if (!file.exists()) {
file.createNewFile();
file.getParentFile().mkdirs();
file.createNewFile();
// file.exists();
}
Expand Down Expand Up @@ -113,7 +111,7 @@ private static Task readLine(String line) {

public static void save(ArrayList<Task> reminder) {
try {
FileWriter fw = new FileWriter(WINDE_FILE);
FileWriter fw = new FileWriter(WINDE_ANOTHER_FILE);
for (Task tasks : reminder) {
fw.write(tasks.toString() + "\n");
}
Expand Down

0 comments on commit 6b1cb98

Please sign in to comment.