главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shpakovsky <alexey@shpakovsky.ru>2014-03-22 15:14:01 +0100
committerAlexey Shpakovsky <alexey@shpakovsky.ru>2014-03-22 15:14:01 +0100
commit7e6816c391643afe1b91c4d4f25ff546ed64df9c (patch)
tree2ee277cf644a372a0714cc8ebd2315d2a7be9183
parent44eea21cf41f65476f32a2c51e7a2e9b4c61ad95 (diff)
save markdown file
-rwxr-xr-xbb.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bb.sh b/bb.sh
index cda88f9..4103996 100755
--- a/bb.sh
+++ b/bb.sh
@@ -167,6 +167,9 @@ global_variables() {
# Regexp matching the HTML line where to do the cut
# note that slash is regexp separator so you need to prepend it with backslash
cut_line='<hr ?\/?>'
+ # save markdown file when posting with "bb post -m"
+ # possible values: "yes", ""
+ save_markdown="yes"
# prefix for tags/categories files
# please make sure that no other html file starts with this prefix
prefix_tags="tag_"
@@ -626,7 +629,11 @@ EOF
fi
done
- rm "$TMPFILE"
+ if [[ "$fmt" == "md" && "$save_markdown" ]]; then
+ mv "$TMPFILE" "${filename%%.*}.md"
+ else
+ rm "$TMPFILE"
+ fi
chmod 644 "$filename"
echo "Posted $filename"
}