From 1685393f4888c6aeee6ba75b1a180a55bb0325ab Mon Sep 17 00:00:00 2001 From: Frank Steinberg <steinberg@ibr.cs.tu-bs.de> Date: Fri, 18 Oct 2019 08:49:57 +0200 Subject: [PATCH] Portability fixes. --- Makefile | 2 +- web/save.cgi | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0d89fb7..a98763c 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ apply: translate: cache/bjcp-2015-styleguide-de-auto.xml cache/bjcp-2015-styleguide-de-auto.xml: - cat bjcp-2015-styleguide-orig.xml | ./translate | xmllint --format - > cache/bjcp-2015-styleguide-de-auto.xml + if [ "$$GOOGLE_APPLICATION_CREDENTIALS" ] ; then cat bjcp-2015-styleguide-orig.xml | ./translate | xmllint --format - > cache/bjcp-2015-styleguide-de-auto.xml ; else curl -s https://familie-steinberg.org/bjcp-styleguide/bjcp-2015-styleguide-de-auto.xml > cache/bjcp-2015-styleguide-de-auto.xml ; fi delete-glossary: curl -X DELETE -H "Authorization: Bearer "`gcloud auth application-default print-access-token` https://translation.googleapis.com/v3beta1/projects/$(PROJECTID)/locations/$(LOCATION)/glossaries/$(GLOSSARYID) diff --git a/web/save.cgi b/web/save.cgi index e91fa6f..c3e2b47 100755 --- a/web/save.cgi +++ b/web/save.cgi @@ -12,7 +12,8 @@ import subprocess -DIR = "/var/www/bjcp-2015-styleguide" +#DIR = "/var/www/bjcp-2015-styleguide" +DIR = "%s/.." % os.environ["CONTEXT_DOCUMENT_ROOT"] LOGFILE = "%s/web/logfile" % DIR SNIPPETDIR = "%s/web/snippets" % DIR LANG = "de" -- GitLab