Merge pull request #4501 from backstage/blam/fix-bitbucket
Fix path parsing for Bitbucket + other preparers
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Fix parsing of the path to default to empty string not undefined if git-url-parse throws something we don't expect. Fixes the error `The "path" argument must be of type string.` when preparing.
|
||||
@@ -43,7 +43,7 @@ export class BitbucketPreparer implements PreparerBase {
|
||||
const targetPath = path.join(workspacePath, 'template');
|
||||
const fullPathToTemplate = path.resolve(
|
||||
checkoutPath,
|
||||
parsedGitUrl.filepath,
|
||||
parsedGitUrl.filepath ?? '',
|
||||
);
|
||||
|
||||
const git = Git.fromAuth({ logger, ...this.getAuth() });
|
||||
|
||||
@@ -33,7 +33,7 @@ export class GithubPreparer implements PreparerBase {
|
||||
const targetPath = path.join(workspacePath, 'template');
|
||||
const fullPathToTemplate = path.resolve(
|
||||
checkoutPath,
|
||||
parsedGitUrl.filepath,
|
||||
parsedGitUrl.filepath ?? '',
|
||||
);
|
||||
|
||||
const git = this.config.token
|
||||
|
||||
@@ -33,7 +33,7 @@ export class GitlabPreparer implements PreparerBase {
|
||||
const targetPath = path.join(workspacePath, 'template');
|
||||
const fullPathToTemplate = path.resolve(
|
||||
checkoutPath,
|
||||
parsedGitUrl.filepath,
|
||||
parsedGitUrl.filepath ?? '',
|
||||
);
|
||||
parsedGitUrl.git_suffix = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user