mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 00:09:23 +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) {
|
function getRepoInfo(githubURL) {
|
||||||
const { type, user, project } = gitInfo.fromUrl(githubURL);
|
const info = gitInfo.fromUrl(githubURL);
|
||||||
// Make sure it's a github url
|
// 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');
|
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) {
|
async function downloadGithubRepo(repoInfo, templatePath) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user