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:
Shahed Nasser
2023-07-11 10:03:23 +03:00
committed by GitHub
parent 09157f0a58
commit 4b4296dc16
3 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"create-medusa-app": patch
---
feat(create-medusa-app): remove .git directory in the project

View File

@@ -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

View File

@@ -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,
})
}