Skip to content

Commit b04bb04

Browse files
committed
use single quotes for non-interpolated strings. output clean-up
1 parent 08976eb commit b04bb04

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

update.sh

+12-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ checkoutdir="${workdir}/${reponame}"
2424
resourcedir="${HOME}/magical-pony"
2525
statusfile='/var/www/html/index.html'
2626

27+
rm -rf /srv/old-clones/
2728
rm -rf "${checkoutdir}"
29+
2830
mkdir -p "${checkoutdir}"
2931

3032
{
@@ -38,9 +40,9 @@ pushd "${checkoutdir}"
3840
# Get a clean version to avoid any merge/reset weirdness
3941
git clone "${repo}" .
4042

41-
echo "<h2>Branches</h2>" >> "${statusfile}"
43+
echo '<h2>Branches</h2>' >> "${statusfile}"
4244

43-
hostnames="-d legal.creativecommons.org"
45+
hostnames='-d legal.creativecommons.org'
4446

4547
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`;
4648
do
@@ -59,8 +61,12 @@ do
5961
perl -p -i -e "s/MAGICALPONY/${branchid}/g" \
6062
"/etc/apache2/sites-enabled/${branchid}".conf
6163
hash=$(git log ${branchname} -1 --format="%H")
62-
echo "<h3>${branchid} (${branchname})</h3><p><b>Commit:</b> <a href=\"https://github.com/creativecommons/creativecommons.org/commit/${hash}\"\>${hash}</a></p>" \
63-
>> "${statusfile}"
64+
{
65+
echo "<h3>${branchid} (${branchname})</h3>"
66+
echo '<p><b>Commit: </b>'
67+
echo " <a href=\"https://github.com/creativecommons/creativecommons.org/commit/${hash}\">${hash}</a>"
68+
echo "</p>"
69+
} >> "${statusfile}"
6470
git log ${branchname} -1 --format="<p>%s</p>" >> "${statusfile}"
6571
done
6672

@@ -75,13 +81,11 @@ popd
7581
--expand --keep-until-expiring --redirect \
7682
${certbotargs}
7783

78-
echo "<h1>And we're done!</h1>" >> "${statusfile}"
84+
echo '<h1>And we are done!</h1>' >> "${statusfile}"
7985

8086
rm -rf /srv/old-clones/
8187

82-
echo "<h2>" >> "${statusfile}"
83-
echo `date` >> "${statusfile}"
84-
echo "</h2>" >> "${statusfile}"
88+
echo "<h2>$(date '+%A %F %T %:::z %Z')</h2>" >> "${statusfile}"
8589

8690
chown www-data:www-data "${statusfile}"
8791

0 commit comments

Comments
 (0)