Skip to content

Commit 4e590e9

Browse files
committed
CLI: remove .git and .github after downloading
1 parent b6b9607 commit 4e590e9

File tree

1 file changed

+13
-1
lines changed
  • npm-packages/cli/source/components/commands

1 file changed

+13
-1
lines changed

npm-packages/cli/source/components/commands/create.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function Create({cli}: {cli: Result<Flags>}) {
5656
</Box>,
5757
);
5858
try {
59-
await $`git clone https://github.com/ClayPulse/pulse-editor-extension-template.git ${name}`;
59+
await $`git clone --depth 1 https://github.com/ClayPulse/pulse-editor-extension-template.git ${name}`;
6060
} catch (error) {
6161
setMessage(
6262
<Text color="redBright">
@@ -83,6 +83,18 @@ export default function Create({cli}: {cli: Result<Flags>}) {
8383
// Write the modified package.json back to the file
8484
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
8585

86+
// Remove the .git directory
87+
const gitDirPath = path.join(process.cwd(), name, '.git');
88+
if (fs.existsSync(gitDirPath)) {
89+
fs.rmSync(gitDirPath, {recursive: true, force: true});
90+
}
91+
92+
// Remove the .github directory
93+
const githubDirPath = path.join(process.cwd(), name, '.github');
94+
if (fs.existsSync(githubDirPath)) {
95+
fs.rmSync(githubDirPath, {recursive: true, force: true});
96+
}
97+
8698
setMessage(
8799
<Box>
88100
<Spinner type="dots" />

0 commit comments

Comments
 (0)