diff options
author | Michael Reed <michael@michaelreed.io> | 2017-07-09 04:52:29 -0400 |
---|---|---|
committer | Michael Reed <michael@michaelreed.io> | 2017-07-09 15:47:52 -0400 |
commit | 73ea470f02ffc256b2abd5956cb38cf6a7ed8330 (patch) | |
tree | 2cfa0c780d3486d61e5b44abfb2f937c79f3e466 /www/publish.sh | |
parent | ac4ba8372107488ea850a74e42e9c978441c6b67 (diff) | |
download | librebootfr-73ea470f02ffc256b2abd5956cb38cf6a7ed8330.tar.gz librebootfr-73ea470f02ffc256b2abd5956cb38cf6a7ed8330.zip |
www/publish.sh: Fix conditionals for file matching
Before the Makefile, publish.sh was executed on markdown source
files using find(1), which happened like this:
./publish.sh ./index.md
Now that we have a Makefile, this happens instead:
./publish.sh index.md
Note that the file argument "index.md" in the first and second case
both refer to the same file, yet they are different strings. This is
important because publish.sh gives index.md (among other files) special
treatment, and it does this by string comparison.
Unfortunately, only the argument in the first case ("./index.md") will
cause publish.sh to give special treatment, while the argumnent in the
second case ("index.md") will not.
To fix this, make it so that both "./index.md" and "index.md" trigger
publish.sh's special handling. This commit also fixes the same issue
for "docs/fdl-1.3.md" and "conduct.md".
Diffstat (limited to 'www/publish.sh')
-rwxr-xr-x | www/publish.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/www/publish.sh b/www/publish.sh index b1b1b405..9c3a4fcd 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -27,7 +27,9 @@ cat "$1" > "$TMPFILE" OPTS="-T Libreboot" -if [ "${FILE}" != "./index" ]; then +if [[ $FILE == "index" || $FILE == "./index" ]]; then + OPTS="--css /headercenter.css" +else if [[ $FILE == *suppliers ]] then RETURN="" @@ -42,15 +44,14 @@ if [ "${FILE}" != "./index" ]; then RETURN="<strong><a href='/git.html#editing-the-website-and-documentation-wiki-style'>Edit this page</a></strong> -- <a href='$DEST'>Back to previous index</a>" OPTS="-T Libreboot" fi -else - OPTS="--css /headercenter.css" fi if [[ $FILE = *suppliers ]]; then printf '\n%s\n' "<strong><a href=\"/git.html#editing-the-website-and-documentation-wiki-style\">Edit this page</a></strong> -- <a href=\"../\">Back to previous page</a>" >> "$TMPFILE" fi -if [ "${FILE}" != "./docs/fdl-1.3" ] && [ "${FILE}" != "./conduct" ]; then +if [[ $FILE != "./docs/fdl-1.3" && $FILE != "docs/fdl-1.3" && + $FILE != "./conduct" && $FILE != "conduct" ]]; then cat footer.md >> "$TMPFILE" fi |