removes POSIX-incompatible :: substitutions in prune_blog
This commit is contained in:
+6
-4
@@ -18,19 +18,21 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
post_rel_path="$(echo "$post" | cut -c${#BLOG_DIR_IN_SRC}- | cut -c3-)"
|
post_rel_path="$(echo "$post" | cut -c${#BLOG_DIR_IN_SRC}- | cut -c3-)"
|
||||||
post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-1}"
|
post_basename_len=$(( ${#post_rel_path} - ( ${#last_segment} + 1 ) ))
|
||||||
|
post_basename="$(echo "${post_rel_path}" | cut -c1-${post_basename_len})"
|
||||||
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
|
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
|
||||||
if [ -f "$post_src" ]
|
if [ -f "$post_src" ]
|
||||||
then
|
then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
penultimate_segment="${post::${#post}-${#last_segment}-1}"
|
penultimate_segment_len=$(( ${#post} - ( ${#last_segment} + 1 ) ))
|
||||||
|
penultimate_segment="$(echo "${post}" | cut -c1-${penultimate_segment_len})"
|
||||||
penultimate_segment="${penultimate_segment##*\.}"
|
penultimate_segment="${penultimate_segment##*\.}"
|
||||||
post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-${#penultimate_segment}-2}"
|
post_basename_len=$(( ${#post_rel_path} - ( ${#last_segment} + ${#penultimate_segment} + 2 ) ))
|
||||||
|
post_basename="$(echo "${post_rel_path}" | cut -c1-${post_basename_len})"
|
||||||
if [ -f "${LAYOUTS}/${penultimate_segment}.layout.${last_segment}" ]
|
if [ -f "${LAYOUTS}/${penultimate_segment}.layout.${last_segment}" ]
|
||||||
then
|
then
|
||||||
post_basename="${post_rel_path::${#post_rel_path}-${#last_segment}-${#penultimate_segment}-2}"
|
|
||||||
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
|
post_src="${BLOGS}/${BLOG}/${post_basename}.${BLOG_EXT}"
|
||||||
if [ -f "$post_src" ]
|
if [ -f "$post_src" ]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user