mirror of https://git.envs.net/envs/bashblog.git
some small changes for bb
This commit is contained in:
parent
ad71aba24e
commit
d676887db7
20
bb.sh
20
bb.sh
|
@ -947,17 +947,17 @@ make_gophermap() {
|
||||||
ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog"
|
ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "${HOME}/public_gopher/blog/gophermap" ]; then
|
if [ ! -f "${HOME}/public_gopher/blog/$gophermap" ]; then
|
||||||
cat <<- 'EOF' > $HOME/public_html/blog/gophermap
|
cat <<- 'EOF' > $HOME/public_html/blog/$gophermap
|
||||||
#!/bin/bash
|
#!/usr/bin/env sh
|
||||||
echo -e "my bashblog posts\n"
|
printf "my bashblog posts\n"
|
||||||
user=$(stat -c '%U' .)
|
user=$(stat -c '%U' .)
|
||||||
for post in $(ls -t *.md); do
|
for post in $(ls -t *.md); do
|
||||||
post=$(basename $post)
|
post=$(basename $post)
|
||||||
echo -e "0$post\t/~$user/blog/$post\ttilde.team\t70"
|
printf "0$post\t/~$user/blog/$post\ttilde.team\t70\n"
|
||||||
done
|
done
|
||||||
EOF
|
EOF
|
||||||
chmod +x $HOME/public_html/blog/gophermap
|
chmod +x $HOME/public_html/blog/$gophermap
|
||||||
fi
|
fi
|
||||||
chmod 644 *.md
|
chmod 644 *.md
|
||||||
}
|
}
|
||||||
|
@ -1176,12 +1176,12 @@ date_version_detect() {
|
||||||
# $1 command to run
|
# $1 command to run
|
||||||
# $2 file name of a draft to continue editing (optional)
|
# $2 file name of a draft to continue editing (optional)
|
||||||
do_main() {
|
do_main() {
|
||||||
|
test -d $HOME/public_html/blog || mkdir -p $HOME/public_html/blog
|
||||||
|
test -f $HOME/public_html/blog/.config || cp /usr/local/bin/bb_user_config.tmpl $HOME/public_html/blog/.config
|
||||||
|
|
||||||
# make sure we're in the right directory
|
# make sure we're in the right directory
|
||||||
[ $(pwd) != $HOME/public_html/blog ] &&
|
[ $(pwd) != $HOME/public_html/blog ] &&
|
||||||
echo "you're not in your blog directory. moving you there now"
|
echo "you're not in your blog directory. moving you there now" && cd $HOME/public_html/blog
|
||||||
test -d $HOME/public_html/blog || mkdir -p $HOME/public_html/blog
|
|
||||||
test -f $HOME/public_html/blog/.config || cp /usr/local/bin/bb_user_config.tmpl $HOME/public_html/blog/.config
|
|
||||||
cd $HOME/public_html/blog
|
|
||||||
|
|
||||||
# Detect if using BSD date or GNU date
|
# Detect if using BSD date or GNU date
|
||||||
date_version_detect
|
date_version_detect
|
||||||
|
|
Loading…
Reference in New Issue