From 47f7a36e6e388cb23380b16abced7dc8c92b4410 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 2 Dec 2019 00:41:48 +0100 Subject: [PATCH] Prevent pending continuation line in generated Dockerfile --- platypush/platydock/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platypush/platydock/__init__.py b/platypush/platydock/__init__.py index 199ed83b..bd20e2a7 100755 --- a/platypush/platydock/__init__.py +++ b/platypush/platydock/__init__.py @@ -88,11 +88,15 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version): && apk add --update --no-cache --virtual git \\ ''') - for dep in deps: - content += '\t&& pip install {} \\\n'.format(dep) + for i, dep in enumerate(deps): + content += '\t&& pip install {}'.format(dep) + if i < len(deps)-1: + content += ' \\'.format(dep) + content += '\n' content += textwrap.dedent( ''' + RUN git clone https://github.com/BlackLight/platypush.git /app && cd /app RUN pip install -r requirements.txt && python setup.py build install RUN apk del git && apk del build-base