Skip to content

Commit

Permalink
Modified scripts to add some checks . Still in barebones version , ne…
Browse files Browse the repository at this point in the history
…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
shrayasr committed Mar 5, 2012
1 parent 4a0ee76 commit 68a75f7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
12 changes: 8 additions & 4 deletions edit.sh
Expand Up @@ -2,6 +2,7 @@


id=1 id=1


echo ""
echo "POSTS" echo "POSTS"
echo "======" echo "======"
cat posts | while read LINE cat posts | while read LINE
Expand All @@ -19,7 +20,10 @@ post=`cat posts | sed -n $sed_arg | cut -d ":" -f1`


open -W $post.markdown open -W $post.markdown


git add . if ! [ "$#" = "1" -a "$1" = "-g" ]
git commit -m "edited post $post" then
git pull origin master git add .
git push origin master git commit -m "edited post $post"
git pull origin master
git push origin master
fi
6 changes: 5 additions & 1 deletion initp.sh
@@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash


rm posts if [ -f posts ]
then
rm posts
fi

touch posts touch posts


ls -l *.markdown | awk '{print $9}' | cut -d "." -f1 | while read LINE ls -l *.markdown | awk '{print $9}' | cut -d "." -f1 | while read LINE
Expand Down
11 changes: 7 additions & 4 deletions new.sh
Expand Up @@ -6,10 +6,13 @@ touch $newpost.markdown


open -W $newpost.markdown open -W $newpost.markdown


git add . if ! [ "$#" = "1" -a "$1" = "-g" ]
git commit -m "New post" then
git pull origin master git add .
git push origin master git commit -m "New post"
git pull origin master
git push origin master
fi


if ! [ -f posts ] if ! [ -f posts ]
then then
Expand Down
4 changes: 4 additions & 0 deletions posts
@@ -0,0 +1,4 @@
20120302174040: example1
20120302174041: example2
20120302174042: example3
20120302174043: Hubticle README

0 comments on commit 68a75f7

Please sign in to comment.