From 060889e8f877925a70e28b66dcc56740aa04e4be Mon Sep 17 00:00:00 2001 From: David Huss <dh@atoav.com> Date: Sun, 31 Oct 2021 15:25:16 +0100 Subject: [PATCH] Try priviledge escalation --- common_config/__init__.py | 2 +- common_config/common.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common_config/__init__.py b/common_config/__init__.py index 921aa11..bd60c8f 100644 --- a/common_config/__init__.py +++ b/common_config/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.1.8' +__version__ = '0.1.9' from common_config.common import * \ No newline at end of file diff --git a/common_config/common.py b/common_config/common.py index 80c8d86..3a79864 100644 --- a/common_config/common.py +++ b/common_config/common.py @@ -425,7 +425,7 @@ def create_config(): config_path.write_text(DEFAULT_CONFIG) except PermissionError as e: python_path = f"{sys.prefix}/bin/python3" - script_path = f"{__file__}" + script_path = f"{os.path.basename(__main__.__file__)}" print() print(f"Error: Didn't have the permissions to write the file to {config_path}", file=sys.stderr) print(f" Directory \"{selection['path']}\" belongs to user {selection['path'].owner()} (was running as user {getpass.getuser()})", file=sys.stderr) diff --git a/pyproject.toml b/pyproject.toml index c3040e2..091f629 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "common-config" -version = "0.1.8" +version = "0.1.9" description = "A config library for eigenservice" authors = ["David Huss <dh@atoav.com>"] -- GitLab