Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create-turbo): correct path usage #9014

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/turbo-utils/src/examples.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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}/` : "/"}`);
Expand All @@ -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;
}

Expand Down
Loading