Skip to content

Commit f00adea

Browse files
committed
Show possible locations when specifying non-existant paths in github CLI integration
1 parent 633cc4b commit f00adea

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

easybuild/tools/github.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,10 +1073,11 @@ def _easyconfigs_pr_common(paths, ecs, start_branch=None, pr_branch=None, start_
10731073
ec_paths.append(path)
10741074

10751075
if non_existing_paths:
1076-
raise EasyBuildError(
1077-
"One or more non-existing paths specified: %s", ', '.join(non_existing_paths),
1078-
exit_code=EasyBuildExit.OPTION_ERROR
1079-
)
1076+
msg = "One or more non-existing paths specified: " + ', '.join(non_existing_paths)
1077+
found_ecs = {ec['spec'] for ec in ecs if os.path.basename(ec['spec']) in non_existing_paths}
1078+
if found_ecs:
1079+
msg += '\nDid you mean: ' + ', '.join(found_ecs)
1080+
raise EasyBuildError(msg, exit_code=EasyBuildExit.OPTION_ERROR)
10801081

10811082
if not any(paths.values()):
10821083
raise EasyBuildError("No paths specified", exit_code=EasyBuildExit.OPTION_ERROR)

0 commit comments

Comments
 (0)