Skip to content

Commit

Permalink
looks good!
Browse files Browse the repository at this point in the history
  • Loading branch information
NACHC-CAD committed Dec 22, 2022
1 parent 0feda22 commit 4656693
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void exec(BufferedWriter writer) {
String fileName = file.getName();
log.info("FILE: " + fileName);
writer.append("\nFILE: " + fileName);
if("MONTHLY".equals(fileName) == false && "github-backup".equals(fileName) == false && file.isDirectory() && fileName.contains(thisMonth) == false) {
if("MONTHLY".equals(fileName) == false && "github-backup".equals(fileName) == false && file.isDirectory() && fileName.startsWith(thisMonth) == false) {
log.info("!!!REMOVING!!!");
writer.append("\n!!!REMOVING!!!");
FileUtil.rmdir(file);
Expand All @@ -49,14 +49,14 @@ public static void exec(BufferedWriter writer) {

private static String getThisMonth() {
Calendar cal = Calendar.getInstance();
String rtn = TimeUtil.format(cal.getTime(), "yyyy_MM");
String rtn = TimeUtil.format(cal.getTime(), "yyyy_MM_");
return rtn;
}

private static String getLastMonth() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.MONTH, -1);
String rtn = TimeUtil.format(cal.getTime(), "yyyy_MM");
String rtn = TimeUtil.format(cal.getTime(), "yyyy_MM_");
return rtn;
}

Expand Down

0 comments on commit 4656693

Please sign in to comment.