1
0
Fork 0

fixed import path

- script was not importing the files in the `/tmp` directory
This commit is contained in:
Kim, Jimin 2022-03-15 11:04:28 +09:00
parent dc374066d8
commit 5e9ee15855
3 changed files with 12 additions and 5 deletions

View file

@ -11,6 +11,9 @@ import os
import sys
from shutil import rmtree
# must be synced with `src/__init__.py`
tmp_dir = "/tmp/com.developomp.setup"
def minimal_check():
"""
@ -58,8 +61,6 @@ def minimal_initialization():
print("Cloning git repository")
tmp_dir = "/tmp/com.developomp.setup"
# remove existing files
if os.path.exists(tmp_dir):
rmtree(tmp_dir)

View file

@ -0,0 +1,2 @@
# must be synced with `setup.py`
tmp_dir = "/tmp/com.developomp.setup"

View file

@ -2,11 +2,15 @@ import inquirer
from glob import glob
from ..util import import_file
from src.log import log
from src import tmp_dir
def choose_action():
files = glob("src/setup/**/*.py")
files = [s.removeprefix("src/setup/") for s in files if "__init__.py" not in s]
files = glob(f"{tmp_dir}/src/setup/**/*.py")
print(files)
files = [
s.removeprefix(f"{tmp_dir}/src/setup/") for s in files if "__init__.py" not in s
]
response = inquirer.prompt(
[
@ -20,7 +24,7 @@ def choose_action():
post_install_tasks = []
for action_name in response["actions"]:
module = import_file(action_name, f"src/setup/{action_name}")
module = import_file(action_name, f"{tmp_dir}/src/setup/{action_name}")
if hasattr(module, "post_install"):
if isinstance(module.post_install, str):