Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix os.makedirs logic #486

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/config/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ def __update_config_values_from_current_state(self):

def load_actions_from_json(self, actions_folder: str) -> list[action]:
result = []
if not os.path.exists(actions_folder):
os.makedirs(actions_folder)
os.makedirs(actions_folder, exist_ok=True)
override_files: list[str] = os.listdir(actions_folder)
for file in override_files:
try:
Expand Down
3 changes: 1 addition & 2 deletions src/games/gameable.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ def find_character_info(self, base_id: str, character_name: str, race: str, gend

@utils.time_it
def __apply_character_overrides(self, overrides_folder: str, character_df_column_headers: list[str]):
if not os.path.exists(overrides_folder):
os.makedirs(overrides_folder)
os.makedirs(overrides_folder, exist_ok=True)
override_files: list[str] = os.listdir(overrides_folder)
for file in override_files:
try:
Expand Down
3 changes: 1 addition & 2 deletions src/games/skyrim.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def prepare_sentence_for_game(self, queue_output: sentence, context_of_conversat
# subtitle = queue_output.sentence
speaker: Character = queue_output.speaker
voice_folder_path = f"{mod_folder}/MantellaVoice00"
if not os.path.exists(voice_folder_path):
os.makedirs(voice_folder_path)
os.makedirs(voice_folder_path, exist_ok=True)
shutil.copyfile(audio_file, f"{voice_folder_path}/{self.WAV_FILE}")
try:
shutil.copyfile(audio_file.replace(".wav", ".lip"), f"{voice_folder_path}/{self.LIP_FILE}")
Expand Down