From a4ff04124290081939452167d84ada0d69cce0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Tue, 13 Sep 2022 22:51:44 +0200 Subject: [PATCH] fix(cli): tune filter for extracting example `.tar` (#40513) As pointed out in https://github.com/vercel/next.js/issues/40389#issuecomment-1243039792, the `filter` matched more files than necessary and merged different example directories together. This change makes the filter match the example directory name precisely. Fixes #40389 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) --- packages/create-next-app/helpers/examples.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-next-app/helpers/examples.ts b/packages/create-next-app/helpers/examples.ts index 961199628d3e..06fef57d27b1 100644 --- a/packages/create-next-app/helpers/examples.ts +++ b/packages/create-next-app/helpers/examples.ts @@ -122,7 +122,7 @@ export async function downloadAndExtractExample(root: string, name: string) { file: tempFile, cwd: root, strip: 3, - filter: (p) => p.includes(`next.js-canary/examples/${name}`), + filter: (p) => p.includes(`next.js-canary/examples/${name}/`), }) await fs.unlink(tempFile)