feat(create-medusa-app): remove --stable option and change to clone default branch (#4794)

This commit is contained in:
Shahed Nasser
2023-08-17 14:34:36 +00:00
committed by GitHub
parent 5cf59a5b9c
commit c684d16ec0
4 changed files with 9 additions and 25 deletions
@@ -9,7 +9,6 @@ type CloneRepoOptions = {
directoryName?: string
repoUrl?: string
abortController?: AbortController
stable?: boolean
}
const DEFAULT_REPO = "https://github.com/medusajs/medusa-starter-default"
@@ -18,14 +17,10 @@ export default async function cloneRepo({
directoryName = "",
repoUrl,
abortController,
stable = false,
}: CloneRepoOptions) {
await promiseExec(
`git clone ${repoUrl || getRepoUrl(stable)} ${directoryName}`,
{
signal: abortController?.signal,
}
)
await promiseExec(`git clone ${repoUrl || DEFAULT_REPO} ${directoryName}`, {
signal: abortController?.signal,
})
}
export async function runCloneRepo({
@@ -33,20 +28,17 @@ export async function runCloneRepo({
repoUrl,
abortController,
spinner,
stable = false,
}: {
projectName: string
repoUrl: string
abortController: AbortController
spinner: Ora
stable?: boolean
}) {
try {
await cloneRepo({
directoryName: projectName,
repoUrl,
abortController,
stable,
})
deleteGitDirectory(projectName)
@@ -69,7 +61,3 @@ function deleteGitDirectory(projectDirectory: string) {
force: true,
})
}
function getRepoUrl(stable?: boolean) {
return !stable ? `${DEFAULT_REPO} -b feat/onboarding` : DEFAULT_REPO
}