1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-26 11:09:22 +03:00

Fetch cheat sheets without installing cht.sh.txt

This commit is contained in:
Anatoli Babenia 2020-07-27 11:03:46 +03:00
parent 981aa35c36
commit 20e371c575
2 changed files with 9 additions and 3 deletions

View File

@ -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"]

View File

@ -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)