summaryrefslogtreecommitdiff
path: root/localikiblogcreate
diff options
context:
space:
mode:
authorJonas <dr@jones.dk>2013-11-13 12:14:17 +0100
committerJonas <dr@jones.dk>2013-11-13 12:14:17 +0100
commit34b192d77c9a1e8c6e292079c3fc2737f6833cb8 (patch)
tree2fb6e170c36c2a2cfd26fb21c94a3661bade237b /localikiblogcreate
parentb64963cc5a3d978f2c8dc291ddd87e9442c5b95b (diff)
Use $HOME (not shell ~) and quote all variables.
Diffstat (limited to 'localikiblogcreate')
-rwxr-xr-xlocalikiblogcreate46
1 files changed, 23 insertions, 23 deletions
diff --git a/localikiblogcreate b/localikiblogcreate
index 4d24381..ae61948 100755
--- a/localikiblogcreate
+++ b/localikiblogcreate
@@ -8,15 +8,15 @@
set -e
-BLOGGITDIR=~/private_git/blog
-BLOGWORKDIR=~/private_webdata/blog
-BLOGWORKDIR=~/public_html
-BLOGPROTO=http
-BLOGHOST=user.homebase.dk
+BLOGGITDIR="$HOME/private_git/blog"
+BLOGWORKDIR="$HOME/private_webdata/blog"
+BLOGWORKDIR="$HOME/public_html"
+BLOGPROTO="http"
+BLOGHOST="user.homebase.dk"
# The above can be overridden
-LOCALCONFIG=/etc/local/ikiblog.conf
-. $LOCALCONFIG || true
+LOCALCONFIG="/etc/local/ikiblog.conf"
+. "$LOCALCONFIG" || true
gitdir="$BLOGGITDIR"
workdir="$BLOGWORKDIR"
@@ -24,33 +24,33 @@ webdir="$BLOGWORKDIR"
baseurl="$BLOGPROTO://$BLOGHOST/~$USER"
# clone/create public repositories
-mkdir -p $gitdir
-git clone --bare git://source.jones.dk/ikiwiki/site $gitdir.git
-git init --bare $gitdir/content.git
+mkdir -p "$gitdir"
+git clone --bare git://source.jones.dk/ikiwiki/site "$gitdir.git"
+git init --bare "$gitdir/content.git"
# clone/create private working repositories
-mkdir -p ~/private_data
-git clone --recursive $gitdir.git $workdir
-git clone $gitdir/content.git $workdir/content
+mkdir -p "$(dirname "$workdir")"
+git clone --recursive "$gitdir.git" "$workdir"
+git clone "$gitdir/content.git" "$workdir/content"
# populate content
-cd $workdir/content
+cd "$workdir/content"
rsync -av /usr/share/ikiwiki/examples/blog/ .
git add .
git commit -m "Initial commit, from sample blog."
git push
# redirect compiled blog to public folder
-mkdir -p $workdir/build
-ln -s $webdir $workdir/build/html
-ln -s $webdir $workdir/build/cgi
+mkdir -p "$workdir/build"
+ln -s "$webdir" "$workdir/build/html"
+ln -s "$webdir" "$workdir/build/cgi"
# Customize settings and bootstrap
-echo "# IkiWiki::Setup::Yaml" > $workdir/config/ikiwiki.setup.in
-echo "url: $baseurl" >> $workdir/config/ikiwiki.setup.in
-echo "cgiurl: $baseurl/ikiwiki.cgi" >> $workdir/config/ikiwiki.setup.in
-echo "theme: goab" >> $workdir/config/ikiwiki.setup.in
-make -C $workdir init
+echo "# IkiWiki::Setup::Yaml" > "$workdir/config/ikiwiki.setup.in"
+echo "url: $baseurl" >> "$workdir/config/ikiwiki.setup.in"
+echo "cgiurl: $baseurl/ikiwiki.cgi" >> "$workdir/config/ikiwiki.setup.in"
+echo "theme: goab" >> "$workdir/config/ikiwiki.setup.in"
+make -C "$workdir" init
# initialize blog
-make -C $workdir
+make -C "$workdir"