remove need to change vars in src/constatnts.py
This commit is contained in:
parent
8bf971e4f1
commit
4951255424
2 changed files with 10 additions and 12 deletions
|
@ -1,9 +1,12 @@
|
|||
# must be synced with `setup.py`
|
||||
# this variable may be altered by the script
|
||||
# most notably by `src/interface/choose_action.py`
|
||||
|
||||
from os import environ
|
||||
from os.path import abspath, dirname
|
||||
|
||||
# used to look for resources
|
||||
# points to repo root
|
||||
content_dir = abspath(dirname(dirname(__file__)))
|
||||
|
||||
# used to temporarily save files
|
||||
# must be synced with `setup.py`
|
||||
tmp_dir = "/tmp/com.developomp.setup"
|
||||
|
||||
content_dir = "/tmp/com.developomp.setup"
|
||||
tmp_dir = content_dir
|
||||
home_dir = environ.get("HOME")
|
||||
|
|
|
@ -4,15 +4,10 @@ from os.path import exists, abspath
|
|||
|
||||
from src.util import import_file
|
||||
from src.log import log
|
||||
import src.constants
|
||||
from src.constants import content_dir
|
||||
|
||||
|
||||
def choose_action():
|
||||
if exists(".git/") and exists("src/"):
|
||||
src.constants.content_dir = abspath(".")
|
||||
|
||||
content_dir = src.constants.content_dir
|
||||
|
||||
files = glob(f"{content_dir}/src/setup/**/*.py")
|
||||
files = [
|
||||
s.removeprefix(f"{content_dir}/src/setup/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue