Skip to content

Commit

Permalink
fs.rmdir -> fs.rmSync
Browse files Browse the repository at this point in the history
  • Loading branch information
sujjeee committed Oct 27, 2023
1 parent 3223e34 commit 20f1fec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
19 changes: 9 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ program
// Handle the success
spinner.success({ text: "Repository cloned successfully" });
// Remove the .git directory
fs_1.default.rmdir(`${dir}/.git`, { recursive: true }, (err) => {
if (err) {
console.error("Error removing .git directory:", err);
console.log("If you encounter any issues, please report them to https://github.com/sujjeee/codox. Your feedback is appreciated! 🙏");
}
else {
console.log(`run cd ${dir} && pnpm install && pnpm dev`);
console.log("Happy Coding! 💻");
}
});
try {
fs_1.default.rmSync(`${dir}/.git`, { recursive: true, force: true });
}
catch (error) {
console.error("Error removing .git directory:", error);
console.log("If you encounter any issues, please report them to https://github.com/sujjeee/codox. Your feedback is appreciated! 🙏");
}
console.log(`run cd ${dir} && pnpm install && pnpm dev`);
console.log("Happy Coding! 💻");
}
}
(0, git_clone_1.default)(repoUrl, dir, cb);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codox",
"version": "1.0.10",
"version": "1.0.11",
"description": "CoDox : A starter template for modern web development with nextjs 13 (app route), tailwindcss, typescript, trpc, clerk auth, and prisma.",
"main": "index.js",
"bin": {
Expand Down
18 changes: 9 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ program

// Define the callback function
function cb(error: Error | undefined) {

if (error) {
// Handle the error
spinner.error({ text: 'Something went wrong!' })
Expand All @@ -28,15 +29,14 @@ program
spinner.success({ text: "Repository cloned successfully" });

// Remove the .git directory
fs.rmdir(`${dir}/.git`, { recursive: true }, (err) => {
if (err) {
console.error("Error removing .git directory:", err);
console.log("If you encounter any issues, please report them to https://github.com/sujjeee/codox. Your feedback is appreciated! 🙏");
} else {
console.log(`run cd ${dir} && pnpm install && pnpm dev`);
console.log("Happy Coding! 💻");
}
});
try {
fs.rmSync(`${dir}/.git`, { recursive: true, force: true });
} catch (error) {
console.error("Error removing .git directory:", error);
console.log("If you encounter any issues, please report them to https://github.com/sujjeee/codox. Your feedback is appreciated! 🙏");
}
console.log(`run cd ${dir} && pnpm install && pnpm dev`);
console.log("Happy Coding! 💻");
}
}
Clone(repoUrl, dir, cb);
Expand Down

0 comments on commit 20f1fec

Please sign in to comment.