Skip to content

Commit

Permalink
Update downloadExtensionRepository.m
Browse files Browse the repository at this point in the history
Remove local function
  • Loading branch information
ehennestad committed Dec 12, 2024
1 parent 16877f9 commit 0bc735f
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions +matnwb/+extension/+internal/downloadExtensionRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,3 @@
end
end
end

function downloadUrl = buildRepoDownloadUrl(repositoryUrl, branchName, extensionName)
% buildRepoDownloadUrl - Build a download URL for a given repository and branch
arguments
repositoryUrl (1,1) string
branchName (1,1) string
extensionName (1,1) string
end

if endsWith(repositoryUrl, '/')
repositoryUrl = extractBefore(repositoryUrl, strlength(repositoryUrl));
end
if contains(repositoryUrl, 'github.com')
downloadUrl = sprintf( '%s/archive/refs/heads/%s.zip', repositoryUrl, branchName );

elseif contains(repositoryUrl, 'gitlab.com')
repoPathSegments = strsplit(repositoryUrl, '/');
repoName = repoPathSegments{end};
downloadUrl = sprintf( '%s/-/archive/%s/%s-%s.zip', ...
repositoryUrl, branchName, repoName, branchName);

else
error('NWB:InstallExtension:UnknownRepository', ...
['Extension "%s" is located in an unsupported repository ', ...
'/ source location. \nPlease create an issue on MatNWB''s ', ...
'github page'], extensionName)
end
end

0 comments on commit 0bc735f

Please sign in to comment.