Pass working directory to execute functions

This commit is contained in:
Fabian Schilling 2021-12-10 18:23:44 +01:00
parent 5821c6782e
commit 2a80e48a92

View file

@ -211,6 +211,10 @@ def create_archive(
) )
) )
try:
working_directory = os.path.expanduser(location_config.get('working_directory'))
except TypeError:
working_directory = None
pattern_file = _write_pattern_file(location_config.get('patterns')) pattern_file = _write_pattern_file(location_config.get('patterns'))
exclude_file = _write_pattern_file( exclude_file = _write_pattern_file(
_expand_home_directories(location_config.get('exclude_patterns')) _expand_home_directories(location_config.get('exclude_patterns'))
@ -283,6 +287,13 @@ def create_archive(
output_log_level, output_log_level,
output_file, output_file,
borg_local_path=local_path, borg_local_path=local_path,
working_directory=working_directory,
) )
return execute_command(full_command, output_log_level, output_file, borg_local_path=local_path) return execute_command(
full_command,
output_log_level,
output_file,
borg_local_path=local_path,
working_directory=working_directory,
)