diff options
author | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2014-05-15 14:39:03 +0200 |
---|---|---|
committer | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2014-05-15 14:39:03 +0200 |
commit | 8f4951219e8697b4687a48e5dfe1b4fcab216233 (patch) | |
tree | 3d0bc7f3aefdd5ff96e9aa84ca36e793c5c48e54 | |
parent | 5bd63c9be31dfe3ccd0e201bb771be8f15eae19f (diff) |
Fixed extra './' strings bug introduced in last commit
-rwxr-xr-x | bb.sh | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -418,7 +418,9 @@ twitter() { # Return 0 (bash return value 'true') if the input file is am index, feed, etc # or 1 (bash return value 'false') if it is a blogpost is_boilerplate_file() { - if [[ "$1" == "$index_file" ]] || [[ "$1" == "$archive_index" ]] || [[ "$1" == "$tags_index" ]] || [[ "$1" == "$footer_file" ]] || [[ "$1" == "$header_file" ]] || [[ "$1" == "$global_analytics_file" ]] || [[ "$1" = "$prefix_tags"* ]] ; then return 0 + name="$1" + [[ "${name:0:2}" == "./" ]] && name=${name:2} # Delete leading './' + if [[ "$name" == "$index_file" ]] || [[ "$name" == "$archive_index" ]] || [[ "$name" == "$tags_index" ]] || [[ "$name" == "$footer_file" ]] || [[ "$name" == "$header_file" ]] || [[ "$name" == "$global_analytics_file" ]] || [[ "$name" = "$prefix_tags"* ]] ; then return 0 else return 1 fi } @@ -743,7 +745,7 @@ rebuild_index() { rebuild_tags() { echo -n "Rebuilding tag pages " n=0 - rm $prefix_tags*.html &> /dev/null + rm ./$prefix_tags*.html &> /dev/null # First we will process all files and create temporal tag files # with just the content of the posts for i in $(ls -t ./*.html); do @@ -771,7 +773,7 @@ rebuild_tags() { done # Now generate the tag files with headers, footers, etc for i in $(ls -t ./$prefix_tags*.tmp.html); do - tagname="$(echo $i | cut -c $((${#prefix_tags}+1))- | sed 's/\.tmp\.html//g')" + tagname="$(echo $i | cut -c $((${#prefix_tags}+3))- | sed 's/\.tmp\.html//g')" create_html_page "$i" "$prefix_tags$tagname.html" yes "$global_title — $template_tag_title \"$tagname\"" rm "$i" done |