diff --git a/.gitignore b/.gitignore index 17a9665..8c1ac75 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ coverage # Dependency directory node_modules bower_components +py_modules # Editors .idea diff --git a/main.py b/main.py index c0ec3ff..0d28f1a 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,8 @@ +import os +import sys +# append py_modules to PYTHONPATH +sys.path.append(os.path.dirname(os.path.realpath(__file__))+"/py_modules") + import logging logging.basicConfig(filename="/tmp/template.log", diff --git a/package.json b/package.json index a5263a1..ea570d7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack", "scripts": { - "build": "shx rm -rf dist && rollup -c", + "pipinstall": "if [ -f requirements.txt ]; then\n\tpip install -U -r requirements.txt -t py_modules\nfi", + "build": "pnpm run pipinstall && shx rm -rf dist && rollup -c", "watch": "rollup -c -w", "test": "echo \"Error: no test specified\" && exit 1" },