Skip to content

Commit

Permalink
reduced code to replace a bookmark in
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinsence committed Jun 26, 2015
1 parent 41388aa commit f661606
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bin/mbm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ add(){
fi

case $overwrite in
y|Y)
y|Y|yes)
echo "**OVERWRITING**"
over=y
sed -i '\^$url^d' $list
;;
lulz)
;;
Expand All @@ -61,11 +61,6 @@ add(){
;;
esac

if [ "$over" = "y" ]
then
grep -v "^${url} |" $list > .temp ; mv .temp $list
fi

urlforfile=$(echo $url | sed 's/[/?=!:_]/-/g')
cachefile=$CACHEDIR/${urlforfile}.html
curl -s $url > $cachefile
Expand All @@ -77,11 +72,11 @@ add(){

for tag in $tags ; do
mkdir -p $BMDIR/tags/$tag
ln -s $cachefile $BMDIR/tags/$tag/${urlforfile}.html
ln -sf $cachefile $BMDIR/tags/$tag/${urlforfile}.html
done

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

fetch(){
Expand Down

0 comments on commit f661606

Please sign in to comment.