Skip to content

Commit 875d63b

Browse files
author
Alan Christie
committed
- Skips /output cwd
1 parent 3366d08 commit 875d63b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/python/pipelines_utils/file_utils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ def pick(filename, directory=None):
4040
"""
4141
if directory is None:
4242
directory = utils.get_undecorated_calling_module()
43-
# Remove the CWD and the anticipated '/' from the front of the module
44-
directory = directory[len(os.getcwd()) + 1:]
43+
# If the 'cwd' is not '/output' (which indicates we're in a Container)
44+
# then remove the CWD and the anticipated '/'
45+
# from the front of the module
46+
if os.getcwd() not in ['/output']:
47+
directory = directory[len(os.getcwd()) + 1:]
4548

4649
file_path = os.path.join(directory, filename)
4750
return file_path if os.path.isfile(file_path) else None
@@ -65,8 +68,11 @@ def pick_sdf(filename, directory=None):
6568
"""
6669
if directory is None:
6770
directory = utils.get_undecorated_calling_module()
68-
# Remove the CWD and the anticipated '/' from the front of the module
69-
directory = directory[len(os.getcwd()) + 1:]
71+
# If the 'cwd' is not '/output' (which indicates we're in a Container)
72+
# then remove the CWD and the anticipated '/'
73+
# from the front of the module
74+
if os.getcwd() not in ['/output']:
75+
directory = directory[len(os.getcwd()) + 1:]
7076

7177
file_path = os.path.join(directory, filename)
7278
if os.path.isfile(file_path + '.sdf.gz'):

src/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_long_description():
2222
setup(
2323

2424
name='im-pipelines-utils',
25-
version='2.3.0',
25+
version='2.3.1',
2626
author='Alan Christie',
2727
author_email='[email protected]',
2828
url='https://github.com/InformaticsMatters/pipelines-utils',

0 commit comments

Comments
 (0)