feat(create-medusa-app): improve by adding depth to clone commands (#10812)

Improve command by passing `--depth 1` to decrease download size + improve for slow speed.

Closes TRI-742
This commit is contained in:
Shahed Nasser
2025-01-05 15:24:57 +02:00
committed by GitHub
parent 18b385aff7
commit 152a94e1e1
4 changed files with 7 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ export default async function cloneRepo({
}: CloneRepoOptions) {
await execute(
[
`git clone ${repoUrl || DEFAULT_REPO} -b ${BRANCH} ${directoryName}`,
`git clone ${repoUrl || DEFAULT_REPO} -b ${BRANCH} ${directoryName} --depth 1`,
{
signal: abortController?.signal,
},

View File

@@ -45,7 +45,6 @@ const execute = async (
childProcess.signal &&
["SIGINT", "SIGTERM"].includes(childProcess.signal)
) {
console.log("abortingggg")
throw getAbortError()
}

View File

@@ -60,10 +60,9 @@ export async function installNextjsStarter({
}
try {
// TODO change back to use create-next-app once Next.js v2 changes land on the main branch
await execute(
[
`git clone ${NEXTJS_REPO} -b ${NEXTJS_BRANCH} ${nextjsDirectory}`,
`git clone ${NEXTJS_REPO} -b ${NEXTJS_BRANCH} ${nextjsDirectory} --depth 1`,
{
signal: abortController?.signal,
env: process.env,