diff --git a/Dockerfile b/Dockerfile index b74ca1b..347b515 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,9 @@ RUN apk add --update --no-cache python2 py2-pip py2-gevent \ && pip install -r requirements.txt \ && apk del build-deps COPY . /app -RUN apk add --update --no-cache curl git py2-virtualenv \ - && ./share/cht.sh.txt --standalone-install +# fetching cheat sheets +RUN apk add --update --no-cache git \ + && mkdir -p /root/.cheat.sh/log/ \ + && python2 lib/fetch.py fetch-all ENTRYPOINT ["python2"] CMD ["bin/srv.py"] diff --git a/lib/fetch.py b/lib/fetch.py index fb8c951..75a0304 100644 --- a/lib/fetch.py +++ b/lib/fetch.py @@ -56,7 +56,11 @@ def fetch_all(skip_existing=True): sys.stdout.write("Fetching %s..." % (adptr)) sys.stdout.flush() - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + try: + process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except OSError: + print("\nERROR: %s" % cmd) + raise output = process.communicate()[0] if process.returncode != 0: sys.stdout.write("\nERROR:\n---\n" + output)