mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add itertools import and update file permissions
This commit is contained in:
parent
0755e0a673
commit
2a7936bfb8
2 changed files with 4 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from io import BytesIO
|
||||
from itertools import chain
|
||||
from os import getenv, sep
|
||||
from os.path import join
|
||||
from pathlib import Path
|
||||
|
|
@ -77,7 +78,7 @@ def install_plugin(plugin_path: Path, db) -> bool:
|
|||
# Copy the plugin
|
||||
copytree(plugin_path, new_plugin_path)
|
||||
# Add u+x permissions to jobs files
|
||||
for job_file in new_plugin_path.joinpath("jobs").glob("*"):
|
||||
for job_file in chain(new_plugin_path.joinpath("jobs").glob("*"), new_plugin_path.joinpath("bwcli").glob("*")):
|
||||
job_file.chmod(job_file.stat().st_mode | S_IEXEC)
|
||||
LOGGER.info(f"Plugin {metadata['id']} installed")
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
from itertools import chain
|
||||
from os import getenv, sep
|
||||
from os.path import join
|
||||
from pathlib import Path
|
||||
|
|
@ -86,7 +87,7 @@ def install_plugin(plugin_path: Path, db, preview: bool = True) -> bool:
|
|||
# Copy the plugin
|
||||
copytree(plugin_path, new_plugin_path)
|
||||
# Add u+x permissions to jobs files
|
||||
for job_file in new_plugin_path.joinpath("jobs").glob("*"):
|
||||
for job_file in chain(new_plugin_path.joinpath("jobs").glob("*"), new_plugin_path.joinpath("bwcli").glob("*")):
|
||||
job_file.chmod(job_file.stat().st_mode | S_IEXEC)
|
||||
LOGGER.info(f"✅ {'Preview version of ' if preview else ''}Pro plugin {metadata['id']} (version {metadata['version']}) installed successfully!")
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue