From 616371e01fa96653bd43f4384a6b8ef68b3661b5 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Wed, 19 Jan 2022 19:03:01 -0600 Subject: get it working with pyinstaller on macos --- browser/util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 browser/util.py (limited to 'browser/util.py') diff --git a/browser/util.py b/browser/util.py new file mode 100644 index 0000000..3d504b3 --- /dev/null +++ b/browser/util.py @@ -0,0 +1,13 @@ +import os +import sys + + +def resource_path(relative_path: str) -> str: + # https://stackoverflow.com/a/13790741 + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + with open('/Users/matt/devel/gemini-client/applog.txt', 'w') as fp: + fp.write(os.path.join(base_path, relative_path)) + return os.path.join(base_path, relative_path) -- cgit v1.2.3