Skip to content

Commit

Permalink
change git commit message to update instead of new when adding an alr…
Browse files Browse the repository at this point in the history
…eady existing bookmark
  • Loading branch information
quentinsence committed Jun 26, 2015
1 parent f661606 commit 22aa2b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/mbm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add(){
[[ -d $BMDIR/.git ]] || git -C $BMDIR init

overwrite=lulz
gitnew="new"
url=$2
#lowercase tags to reduce duplicate categories
tags=${@:3}
Expand All @@ -53,6 +54,7 @@ add(){
y|Y|yes)
echo "**OVERWRITING**"
sed -i '\^$url^d' $list
gitnew="update"
;;
lulz)
;;
Expand All @@ -76,12 +78,12 @@ add(){
done

git -C $BMDIR add .
git -C $BMDIR commit -am "new bookmark $url"
git -C $BMDIR commit -am "$gitnew bookmark $url"
}

fetch(){
#
awk -F '|' -v BMDIR=$BMDIR '{
#fetch again all links. record all changes
awk -F '|' -v BMDIR=$BMDIR '{
printf("\n%5d update %s",NR,$3)
system("curl "$1" > "$3"")
system("git -C "BMDIR" commit -am \"updated "$1"\"")
Expand Down

0 comments on commit 22aa2b6

Please sign in to comment.