feat(create-medusa-app): remove .git directory in the project (#4493)
* feat(create-medusa-app): remove .git directory in the project * reverted version changes * remove version from package.json
This commit is contained in:
5
.changeset/chilled-hairs-unite.md
Normal file
5
.changeset/chilled-hairs-unite.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-medusa-app": patch
|
||||
---
|
||||
|
||||
feat(create-medusa-app): remove .git directory in the project
|
||||
@@ -20,7 +20,7 @@ Node.js is the environment that makes it possible for Medusa to run, so you must
|
||||
|
||||
:::caution
|
||||
|
||||
Medusa supports v16 or greater of Node.js. You can check your Node.js version using the following command:
|
||||
Medusa supports v16+ of Node.js. You can check your Node.js version using the following command:
|
||||
|
||||
```bash noReport
|
||||
node -v
|
||||
|
||||
@@ -2,6 +2,8 @@ import promiseExec from "./promise-exec.js"
|
||||
import { Ora } from "ora"
|
||||
import { isAbortError } from "./create-abort-controller.js"
|
||||
import logMessage from "./log-message.js"
|
||||
import fs from "fs"
|
||||
import path from "path"
|
||||
|
||||
type CloneRepoOptions = {
|
||||
directoryName?: string
|
||||
@@ -39,6 +41,8 @@ export async function runCloneRepo({
|
||||
repoUrl,
|
||||
abortController,
|
||||
})
|
||||
|
||||
deleteGitDirectory(projectName)
|
||||
} catch (e) {
|
||||
if (isAbortError(e)) {
|
||||
process.exit()
|
||||
@@ -51,3 +55,10 @@ export async function runCloneRepo({
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function deleteGitDirectory(projectDirectory: string) {
|
||||
fs.rmSync(path.join(projectDirectory, ".git"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user