move to blog dir a proper if block instead of && chain

This commit is contained in:
James Tomasino 2020-10-29 00:03:46 +00:00
parent d0e7d60d93
commit 554ad1615b
1 changed files with 6 additions and 4 deletions

10
bb.sh
View File

@ -891,7 +891,7 @@ make_gophermap() {
EOF
chmod +x "${HOME}/public_html/blog/${gophermap}"
fi
chmod 644 ./*.md
chmod 644 "./*.md"
}
make_gemini() {
@ -1111,9 +1111,11 @@ date_version_detect() {
# $2 file name of a draft to continue editing (optional)
do_main() {
# make sure we're in the right directory
[ "$(pwd)" != "$HOME/public_html/blog" ] &&
echo "you're not in your blog directory. moving you there now" && \
mkdir -p "$HOME/public_html/blog" && cd "$HOME/public_html/blog" || exit 1
if [ "$(pwd)" != "$HOME/public_html/blog" ]; then
echo "you're not in your blog directory. moving you there now"
mkdir -p "$HOME/public_html/blog"
cd "$HOME/public_html/blog" || exit 1
fi
# Detect if using BSD date or GNU date
date_version_detect