mirror of
https://github.com/strapi/strapi.git
synced 2025-08-05 23:40:04 +00:00
Better error handling
Signed-off-by: Rémi de Juvigny <remi@hey.com>
This commit is contained in:
parent
0e064d10e8
commit
e64ac06af8
@ -100,13 +100,13 @@ async function checkTemplateContentsStructure(templateContentsPath) {
|
||||
}
|
||||
|
||||
function getRepoInfo(githubURL) {
|
||||
const { type, user, project } = gitInfo.fromUrl(githubURL);
|
||||
const info = gitInfo.fromUrl(githubURL);
|
||||
// Make sure it's a github url
|
||||
if (type !== 'github') {
|
||||
if (info == null || info.type !== 'github') {
|
||||
throw Error('A Strapi template can only be a GitHub URL');
|
||||
}
|
||||
|
||||
return { user, project };
|
||||
return { user: info.user, project: info.project };
|
||||
}
|
||||
|
||||
async function downloadGithubRepo(repoInfo, templatePath) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user