alessandro trinca tornidor commited on
Commit
6ae973f
1 Parent(s): e8e31ef

move folder creation code to a dedicated function

Browse files
scripts/create_folders_and_variables_if_not_exists.py CHANGED
@@ -31,7 +31,7 @@ def create_folder_if_not_exists(pathname: Path | str):
31
  assert current_pathname.is_dir()
32
 
33
 
34
- if __name__ == '__main__':
35
  folders_string = os.getenv("FOLDERS_MAP")
36
  try:
37
  folders_dict = json.loads(folders_string)
@@ -48,4 +48,8 @@ if __name__ == '__main__':
48
  logging.info("double check your variables, e.g. for mispelling like 'FOLDER_MAP' instead than 'FOLDERS_MAP'...")
49
  for k_env, v_env in dict(os.environ).items():
50
  print(f"{k_env}, v_env:{v_env}.")
51
- logging.info(f"{k_env}, v_env:{v_env}.")
 
 
 
 
 
31
  assert current_pathname.is_dir()
32
 
33
 
34
+ def run_folder_creation():
35
  folders_string = os.getenv("FOLDERS_MAP")
36
  try:
37
  folders_dict = json.loads(folders_string)
 
48
  logging.info("double check your variables, e.g. for mispelling like 'FOLDER_MAP' instead than 'FOLDERS_MAP'...")
49
  for k_env, v_env in dict(os.environ).items():
50
  print(f"{k_env}, v_env:{v_env}.")
51
+ logging.info(f"{k_env}, v_env:{v_env}.")
52
+
53
+
54
+ if __name__ == '__main__':
55
+ run_folder_creation()