Skip to content

Commit 2102678

Browse files
committed
Remove superflous check
We already know the subdir and just need to append the path separator for the prefix-check
1 parent 23ed09a commit 2102678

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

easybuild/tools/github.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -753,13 +753,6 @@ def commit_request_fn(gh):
753753
# download tarball for specific commit
754754
repo_commit = download_repo(repo=github_repo, commit=commit, account=github_account)
755755

756-
if github_repo == GITHUB_EASYCONFIGS_REPO:
757-
files_subdir = 'easybuild/easyconfigs/'
758-
elif github_repo == GITHUB_EASYBLOCKS_REPO:
759-
files_subdir = 'easybuild/easyblocks/'
760-
else:
761-
raise EasyBuildError("Unknown repo: %s", github_repo, exit_code=EasyBuildExit.OPTION_ERROR)
762-
763756
# symlink subdirectories of 'easybuild/easy{blocks,configs}' into path that gets added to robot search path
764757
mkdir(path, parents=True)
765758
dirpath = os.path.join(repo_commit, easybuild_subdir)
@@ -768,6 +761,7 @@ def commit_request_fn(gh):
768761

769762
# copy specified files to directory where they're expected to be found
770763
file_paths = []
764+
subdir_prefix = easybuild_subdir + os.path.sep
771765
for file in files:
772766

773767
# if only filename is specified, we need to determine the file path
@@ -782,8 +776,8 @@ def commit_request_fn(gh):
782776

783777
# strip of leading subdirectory like easybuild/easyconfigs/ or easybuild/easyblocks/
784778
# because that's what expected by robot_find_easyconfig
785-
if file.startswith(files_subdir):
786-
file = file[len(files_subdir):]
779+
if file.startswith(subdir_prefix):
780+
file = file[len(subdir_prefix):]
787781

788782
# if file is found, copy it to dedicated directory;
789783
# if not, just skip it (may be an easyconfig file in local directory);

0 commit comments

Comments
 (0)