Added expanduser to paths

This commit is contained in:
Edgar P. Burkhart 2022-01-23 13:42:53 +01:00
parent d9297b4312
commit 813eba5b1b
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -32,8 +32,9 @@ log = logging.getLogger('openfoam')
log.info('Starting program') log.info('Starting program')
input_dir = Path(config.get('main', 'input_dir'), config.get('main', 'case')) input_dir = Path(config.get('main', 'input_dir'), config.get('main', 'case'))\
work_dir = Path(config.get('main', 'work_dir')) .expanduser()
work_dir = Path(config.get('main', 'work_dir')).expanduser()
if not work_dir.exists(): if not work_dir.exists():
log.error(f'Work directory ({work_dir}) not found') log.error(f'Work directory ({work_dir}) not found')
@ -59,7 +60,7 @@ if config.getboolean('stl', 'copy', fallback=False):
('rm', '-r', stl_dir) ('rm', '-r', stl_dir)
) )
stl_in = Path(config.get('stl', 'from')) stl_in = Path(config.get('stl', 'from')).expanduser()
log.info(f'Copying stl directory ({stl_in} -> {stl_dir})') log.info(f'Copying stl directory ({stl_in} -> {stl_dir})')
sp.run( sp.run(
('cp', '-r', stl_in, stl_dir) ('cp', '-r', stl_in, stl_dir)