Skip to content

Commit

Permalink
Check config dir exists before writing to it
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell committed May 21, 2023
1 parent 6ee108b commit c14f588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ def write_environment_variables(
self, permit_cfg_dir_save: bool = True
) -> None:
config_dir = os.environ.get(DockerEnvVar.CONFIG_HOST_DIR)
if config_dir and permit_cfg_dir_save:
if config_dir and os.path.exists(config_dir) and permit_cfg_dir_save:
filename = os.path.join(config_dir, HostPath.ENVVAR_SAVE_FILE)
with open(filename, mode="w") as f:
self._write_envvars_to_file(f)
Expand Down

0 comments on commit c14f588

Please sign in to comment.