Remap: Refactor scripts #177

Merged
Nick Alberelli merged 17 commits from :feature/refactor-remap-script into main 2023-12-07 16:17:27 +01:00
Showing only changes of commit 720cf71c96 - Show all commits

View File

@ -15,7 +15,10 @@ def get_current_dir():
def get_variable_file_path(): def get_variable_file_path():
directory = get_current_dir() directory = get_current_dir()
return directory.joinpath(".env") variables_dir = directory.joinpath("var")
if not variables_dir.exists():
variables_dir.mkdir()
return variables_dir.joinpath("remap_variables.json")
def get_variable_file(): def get_variable_file():
@ -30,7 +33,6 @@ def remove_variable_file():
def get_variables(): def get_variables():
# TODO FIX Saving JSON because os.environ.get() doesn't work when running this as a script
var_file = Path(get_variable_file()) var_file = Path(get_variable_file())
var_file_data = open(var_file) var_file_data = open(var_file)
var_file_dict = json.load(var_file_data) var_file_dict = json.load(var_file_data)