Skip to content
Browse files

Modified scripts to add some checks . Still in barebones version , ne…

…ed to add a help part and all . Now can choose not to commit to the git repo by using a "-g" switch on both the new and edit shell scripts
  • Loading branch information...
1 parent 4a0ee76 commit 68a75f7114fefa1a2f8b7ccd354c5fe44c9e2156 @shrayasr shrayasr committed
Showing with 24 additions and 9 deletions.
  1. +8 −4 edit.sh
  2. +5 −1 initp.sh
  3. +7 −4 new.sh
  4. +4 −0 posts
View
12 edit.sh
@@ -2,6 +2,7 @@
id=1
+echo ""
echo "POSTS"
echo "======"
cat posts | while read LINE
@@ -19,7 +20,10 @@ post=`cat posts | sed -n $sed_arg | cut -d ":" -f1`
open -W $post.markdown
-git add .
-git commit -m "edited post $post"
-git pull origin master
-git push origin master
+if ! [ "$#" = "1" -a "$1" = "-g" ]
+then
+ git add .
+ git commit -m "edited post $post"
+ git pull origin master
+ git push origin master
+fi
View
6 initp.sh
@@ -1,6 +1,10 @@
#!/bin/bash
-rm posts
+if [ -f posts ]
+then
+ rm posts
+fi
+
touch posts
ls -l *.markdown | awk '{print $9}' | cut -d "." -f1 | while read LINE
View
11 new.sh
@@ -6,10 +6,13 @@ touch $newpost.markdown
open -W $newpost.markdown
-git add .
-git commit -m "New post"
-git pull origin master
-git push origin master
+if ! [ "$#" = "1" -a "$1" = "-g" ]
+then
+ git add .
+ git commit -m "New post"
+ git pull origin master
+ git push origin master
+fi
if ! [ -f posts ]
then
View
4 posts
@@ -0,0 +1,4 @@
+20120302174040: example1
+20120302174041: example2
+20120302174042: example3
+20120302174043: Hubticle README

0 comments on commit 68a75f7

Please sign in to comment.
Something went wrong with that request. Please try again.