summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]mktoday (renamed from dayXX.java)14
1 files changed, 14 insertions, 0 deletions
diff --git a/dayXX.java b/mktoday
index bf50f5e..07b07d4 100644..100755
--- a/dayXX.java
+++ b/mktoday
@@ -1,3 +1,16 @@
+#!/bin/bash
+
+day=$(date +%d)
+
+[ -d day${day} ] && {
+ echo "Today already exists!"
+ exit 1
+}
+
+mkdir day${day}
+touch day${day}/test
+touch day${day}/input
+sed -e "s/XX/${day}/g" > day${day}/day${day}.java <<EOJAVA
import java.io.IOException;
import java.io.RandomAccessFile;
@@ -18,3 +31,4 @@ public class dayXX {
return "WIP";
}
}
+EOJAVA