aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--20210525_0828405
-rw-r--r--bin/add-new.sh5
2 files changed, 10 insertions, 0 deletions
diff --git a/20210525_082840 b/20210525_082840
new file mode 100644
index 0000000..61dfd16
--- /dev/null
+++ b/20210525_082840
@@ -0,0 +1,5 @@
+[NEWS] Created script to quickly add news to the repo
+
+I only use timestamp for file name. I open an editor for that and from there, the first line is the title as happens most of the times.
+
+I use the first line as a message to the commit which is happening after the file is saved.
diff --git a/bin/add-new.sh b/bin/add-new.sh
new file mode 100644
index 0000000..2f7da1f
--- /dev/null
+++ b/bin/add-new.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+export NEWS_FILE=$(date +%Y%m%d_%H%M%S)"
+vi $NEWS_FILE
+git add $NEWS_FILE
+git commit -m "$(head -n 1 $NEWS_FILE)"