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:
1 parent
09157f0a58
commit
4b4296dc16
3 files changed
+17
-1
No files matched your search
@@ -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
|
:::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
|
```bash noReport
|
||||||
node -v
|
node -v
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import promiseExec from "./promise-exec.js"
|
|||||||
import { Ora } from "ora"
|
import { Ora } from "ora"
|
||||||
import { isAbortError } from "./create-abort-controller.js"
|
import { isAbortError } from "./create-abort-controller.js"
|
||||||
import logMessage from "./log-message.js"
|
import logMessage from "./log-message.js"
|
||||||
|
import fs from "fs"
|
||||||
|
import path from "path"
|
||||||
|
|
||||||
type CloneRepoOptions = {
|
type CloneRepoOptions = {
|
||||||
directoryName?: string
|
directoryName?: string
|
||||||
@@ -39,6 +41,8 @@ export async function runCloneRepo({
|
|||||||
repoUrl,
|
repoUrl,
|
||||||
abortController,
|
abortController,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
deleteGitDirectory(projectName)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (isAbortError(e)) {
|
if (isAbortError(e)) {
|
||||||
process.exit()
|
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