Remap: Refactor scripts #177
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user