diff --git a/usr/lib/python3.6/lxcmgr/pkgmgr.py b/usr/lib/python3.6/lxcmgr/pkgmgr.py index 970ed98..5d39964 100644 --- a/usr/lib/python3.6/lxcmgr/pkgmgr.py +++ b/usr/lib/python3.6/lxcmgr/pkgmgr.py @@ -194,9 +194,14 @@ class PkgMgr: def run_script(self, app, script): # Runs script for an app, if the script is present - script_path = os.path.join(REPO_CACHE_DIR, 'apps', app, script) + script_dir = os.path.join(REPO_CACHE_DIR, 'apps', app) + script_path = os.path.join(script_dir, script) if os.path.exists(script_path): + # Change working directory, so the script doesn't have to figure out paths to packaged files + cwd = os.getcwd() + os.chdir(script_dir) subprocess.run(script_path, check=True) + os.chdir(cwd) def register_app(self, app, metadata): # Register installed app in list of installed apps