From a88aa8ff7137c4685772e61377ae3ec9095fbfd9 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 16 Aug 2022 13:44:53 +0200 Subject: [PATCH] chore: fix behaviour on windows for absolute paths Signed-off-by: blam --- .../src/scaffolder/actions/builtin/fetch/template.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/template.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/template.ts index 5e5b7052ed..bbba4f2fb3 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/template.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/template.ts @@ -301,12 +301,13 @@ export function createFetchTemplateAction(options: { } function containsSkippedContent(localOutputPath: string): boolean { - // if the path is absolute means that the root directory has been skipped // if the path is empty means that there is a file skipped in the root + // if the path is starts with a separator it means that the root directory has been skipped // if the path includes // means that there is a subdirectory skipped + // All paths returned are considered with / seperator because of globby returning the linux seperator for all os'. return ( localOutputPath === '' || - path.isAbsolute(localOutputPath) || - localOutputPath.includes(`${path.sep}${path.sep}`) + localOutputPath.startsWith('/') || + localOutputPath.includes('//') ); }