From ea6752c0cc8fb3e43c8b3e49da33c8d94d3fa21f Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Thu, 26 Sep 2024 10:56:11 +0200 Subject: [PATCH] fix: template missing return --- .../create-strapi-app/src/utils/template.ts | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/cli/create-strapi-app/src/utils/template.ts b/packages/cli/create-strapi-app/src/utils/template.ts index 6d4f65bd81..b9e5ccbbdb 100644 --- a/packages/cli/create-strapi-app/src/utils/template.ts +++ b/packages/cli/create-strapi-app/src/utils/template.ts @@ -75,12 +75,23 @@ export async function copyTemplate(scope: Scope, rootPath: string) { } if (scope.templateBranch) { - await downloadGithubRepo(rootPath, { - owner, - repo, - branch: scope.templateBranch, - subPath: scope.templatePath, - }); + await retry( + () => + downloadGithubRepo(rootPath, { + owner, + repo, + branch: scope.templateBranch, + subPath: scope.templatePath, + }), + { + retries: 3, + onRetry(err, attempt) { + console.log(`Retrying to download the template. Attempt ${attempt}. Error: ${err}`); + }, + } + ); + + return; } await retry(