From 813eba5b1b0031193682fc809dd0853fe8c4f106 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 23 Jan 2022 13:42:53 +0100 Subject: [PATCH] Added expanduser to paths --- openfoam/run/__main__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openfoam/run/__main__.py b/openfoam/run/__main__.py index 900b9e6..4bf9cca 100644 --- a/openfoam/run/__main__.py +++ b/openfoam/run/__main__.py @@ -32,8 +32,9 @@ log = logging.getLogger('openfoam') log.info('Starting program') -input_dir = Path(config.get('main', 'input_dir'), config.get('main', 'case')) -work_dir = Path(config.get('main', 'work_dir')) +input_dir = Path(config.get('main', 'input_dir'), config.get('main', 'case'))\ + .expanduser() +work_dir = Path(config.get('main', 'work_dir')).expanduser() if not work_dir.exists(): log.error(f'Work directory ({work_dir}) not found') @@ -59,7 +60,7 @@ if config.getboolean('stl', 'copy', fallback=False): ('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})') sp.run( ('cp', '-r', stl_in, stl_dir)