Remove unnecessary catch (#13639)
This undoes https://github.com/vercel/next.js/pull/13138 as the rename is done.
This commit is contained in:
parent
795d9319a6
commit
1f49400a32
1 changed files with 5 additions and 19 deletions
|
@ -83,7 +83,7 @@ export function downloadAndExtractRepo(
|
|||
)
|
||||
}
|
||||
|
||||
export async function downloadAndExtractExample(
|
||||
export function downloadAndExtractExample(
|
||||
root: string,
|
||||
name: string
|
||||
): Promise<void> {
|
||||
|
@ -91,24 +91,10 @@ export async function downloadAndExtractExample(
|
|||
throw new Error('This is an internal example for testing the CLI.')
|
||||
}
|
||||
|
||||
try {
|
||||
return await pipeline(
|
||||
got.stream('https://codeload.github.com/vercel/next.js/tar.gz/canary'),
|
||||
tar.extract({ cwd: root, strip: 3 }, [`next.js-canary/examples/${name}`])
|
||||
)
|
||||
} catch (err) {
|
||||
// TODO: remove after this change has been landed
|
||||
if (err?.response?.statusCode === 404) {
|
||||
return pipeline(
|
||||
got.stream('https://codeload.github.com/vercel/next.js/tar.gz/canary'),
|
||||
tar.extract({ cwd: root, strip: 3 }, [
|
||||
`next.js-canary/examples/${name}`,
|
||||
])
|
||||
)
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
return pipeline(
|
||||
got.stream('https://codeload.github.com/vercel/next.js/tar.gz/canary'),
|
||||
tar.extract({ cwd: root, strip: 3 }, [`next.js-canary/examples/${name}`])
|
||||
)
|
||||
}
|
||||
|
||||
export async function listExamples(): Promise<any> {
|
||||
|
|
Loading…
Reference in a new issue