From ce8003114dfedd1cf7fdf0e9d10eb4cc3d01a3b9 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 24 Mar 2019 16:13:37 +0100 Subject: [PATCH] Add packages in setup.cfg --- remote/__main__.py | 6 +++++- setup.cfg | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/remote/__main__.py b/remote/__main__.py index 472c42c..a525c5a 100644 --- a/remote/__main__.py +++ b/remote/__main__.py @@ -178,15 +178,19 @@ def upload_env(): "COPANIER_SMTP_LOGIN": None, } content = "" + table = str.maketrans({'"': r"\""}) for key, value in vars_.items(): + value = value or os.environ[key] try: - content += "{}={}\n".format(key, value or os.environ[key]) + content += f'{key}="{str(value).translate(table)}"\n' except KeyError: sys.exit(f"The {key} environment variable does not exist.") path = "/srv/copanier/env" if exists(path): run(f"cat {path}") put(StringIO(content), path) + if exists(path): + run(f"cat {path}") @minicli.wrap diff --git a/setup.cfg b/setup.cfg index 2cf5edc..3018dab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,7 @@ name = copanier version = 0.0.1 [options] +packages = find: install_requires = Jinja2==2.10 minicli==0.4.4