Skip to content

Commit

Permalink
feat(create-medusa-app): improve by adding depth to clone commands (#…
Browse files Browse the repository at this point in the history
…10812)

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

Closes TRI-742
  • Loading branch information
shahednasser authored Jan 5, 2025
1 parent 18b385a commit 152a94e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-bananas-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-medusa-app": patch
---

feat(create-medusa-app): improve by adding depth to clone commands
2 changes: 1 addition & 1 deletion packages/cli/create-medusa-app/src/utils/clone-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
1 change: 0 additions & 1 deletion packages/cli/create-medusa-app/src/utils/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const execute = async (
childProcess.signal &&
["SIGINT", "SIGTERM"].includes(childProcess.signal)
) {
console.log("abortingggg")
throw getAbortError()
}

Expand Down
3 changes: 1 addition & 2 deletions packages/cli/create-medusa-app/src/utils/nextjs-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 152a94e

Please sign in to comment.