2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 10:05:39 +00:00

Refactor code (so that it actually runs)...

- Invoke does not have access to the local virtual environment
- Some functions need to be split out from settings.py
This commit is contained in:
Oliver
2022-01-06 14:20:26 +11:00
parent 836b6275b6
commit d8d22e5f38
4 changed files with 102 additions and 70 deletions

View File

@ -77,21 +77,14 @@ def plugins(c):
Installs all plugins as specified in 'plugins.txt'
"""
try:
from InvenTree.InvenTree.settings import PLUGIN_FILE
except:
print("Error: Could not import PLUGIN_FILE from settings.py")
return
if not os.path.exists(PLUGIN_FILE):
# Create an empty plugin
print(f"Plugins file '{PLUGIN_FILE}' does not exist")
return
from InvenTree.InvenTree.config import get_plugin_file
print(f"Installing plugin packages from '{PLUGIN_FILE}'")
plugin_file = get_plugin_file()
print(f"Installing plugin packages from '{plugin_file}'")
# Install the plugins
c.run(f"pip3 install -U -r '{PLUGIN_FILE}'")
c.run(f"pip3 install -U -r '{plugin_file}'")
@task(post=[plugins])
def install(c):