From 4c0f2bb82e153bb0955fc282277bc4dfea418c7b Mon Sep 17 00:00:00 2001 From: tknickman Date: Thu, 15 Aug 2024 09:32:58 -0400 Subject: [PATCH] fix(create-turbo): correct path usage --- packages/turbo-utils/src/examples.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/turbo-utils/src/examples.ts b/packages/turbo-utils/src/examples.ts index d912807f72b87..d41eff1f4f26f 100644 --- a/packages/turbo-utils/src/examples.ts +++ b/packages/turbo-utils/src/examples.ts @@ -1,6 +1,6 @@ import { Stream } from "node:stream"; import { promisify } from "node:util"; -import { join, sep } from "node:path"; +import { join } from "node:path"; import { tmpdir } from "node:os"; import { createWriteStream, promises as fs } from "node:fs"; import { x as extract } from "tar"; @@ -123,7 +123,7 @@ export async function downloadAndExtractRepo( // old repository name is used to fetch the example. The tar download will work as it is redirected automatically, but the root directory of the extracted // example will be the new, renamed name instead of the name used to fetch the example. if (rootPath === null) { - const pathSegments = p.split(sep); + const pathSegments = p.split("/"); rootPath = pathSegments.length ? pathSegments[0] : null; } return p.startsWith(`${rootPath}${filePath ? `/${filePath}/` : "/"}`); @@ -149,7 +149,7 @@ export async function downloadAndExtractExample(root: string, name: string) { // old repository name is used to fetch the example. The tar download will work as it is redirected automatically, but the root directory of the extracted // example will be the new, renamed name instead of the name used to fetch the example. if (rootPath === null) { - const pathSegments = p.split(sep); + const pathSegments = p.split("/"); rootPath = pathSegments.length ? pathSegments[0] : null; }