From 9352c0eafeb645b2103814e54cfba6886ec43b71 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Tue, 4 Aug 2020 21:11:17 -0700 Subject: [PATCH] install: added core-python wrapper script to core virtual environment --- tasks.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks.py b/tasks.py index 38b219e6..d76bc01d 100644 --- a/tasks.py +++ b/tasks.py @@ -271,6 +271,18 @@ def install_scripts(c, verbose=False, prefix=DEFAULT_PREFIX): else: c.run(f"sudo cp {script} {dest}", hide=hide) + # setup core python helper + core_python = bin_dir.joinpath("core-python") + temp = NamedTemporaryFile("w", delete=False) + temp.writelines([ + "#!/bin/bash\n", + f'exec "{python}" "$@"\n', + ]) + temp.close() + c.run(f"sudo cp {temp.name} {core_python}", hide=hide) + c.run(f"sudo chmod 755 {core_python}", hide=hide) + os.unlink(temp.name) + # install core configuration file config_dir = "/etc/core" c.run(f"sudo mkdir -p {config_dir}", hide=hide) @@ -402,6 +414,10 @@ def uninstall(c, dev=False, verbose=False, prefix=DEFAULT_PREFIX): dest = bin_dir.joinpath(script.name) c.run(f"sudo rm -f {dest}", hide=hide) + # remove core-python symlink + core_python = bin_dir.joinpath("core-python") + c.run(f"sudo rm -f {core_python}", hide=hide) + # install service systemd_dir = Path("/lib/systemd/system/") service_name = "core-daemon.service"