diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 9ad7db5e3..bf1af24d7 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -4,7 +4,7 @@ We want to thank all the amazing contributors who have helped make TermUI what i
| Avatar | Contributor | Contributions |
| :---: | :--- | :---: |
-|
| [@Karanjot786](https://github.com/Karanjot786) | 347 |
+|
| [@Karanjot786](https://github.com/Karanjot786) | 348 |
|
| [@Tomeshwari-02](https://github.com/Tomeshwari-02) | 155 |
|
| [@ionfwsrijan](https://github.com/ionfwsrijan) | 92 |
|
| [@srushti-panara](https://github.com/srushti-panara) | 86 |
@@ -144,7 +144,7 @@ We want to thank all the amazing contributors who have helped make TermUI what i
|
| [@nkapoor175](https://github.com/nkapoor175) | 1 |
|
| [@MeghPatel-007](https://github.com/MeghPatel-007) | 1 |
|
| [@ezManish](https://github.com/ezManish) | 1 |
-|
| [@Novice47](https://github.com/Novice47) | 1 |
+|
| [@manasvi-sahare](https://github.com/manasvi-sahare) | 1 |
|
| [@ShubhamSawant726](https://github.com/ShubhamSawant726) | 1 |
|
| [@Sneha6657](https://github.com/Sneha6657) | 1 |
|
| [@sujeetkumar1425](https://github.com/sujeetkumar1425) | 1 |
@@ -160,6 +160,7 @@ We want to thank all the amazing contributors who have helped make TermUI what i
|
| [@saam-07](https://github.com/saam-07) | 1 |
|
| [@sripriya1156](https://github.com/sripriya1156) | 1 |
|
| [@vidushi1129](https://github.com/vidushi1129) | 1 |
+|
| [@Novice47](https://github.com/Novice47) | 1 |
|
| [@Dev-aaditya](https://github.com/Dev-aaditya) | 1 |
|
| [@AbhishekAwasthi47](https://github.com/AbhishekAwasthi47) | 1 |
|
| [@A-adilajaleel](https://github.com/A-adilajaleel) | 1 |
@@ -172,6 +173,7 @@ We want to thank all the amazing contributors who have helped make TermUI what i
|
| [@ravichandra14](https://github.com/ravichandra14) | 1 |
|
| [@bhumindeshpande8-spec](https://github.com/bhumindeshpande8-spec) | 1 |
|
| [@CoderPrateek971](https://github.com/CoderPrateek971) | 1 |
+|
| [@Dippp10-ally](https://github.com/Dippp10-ally) | 1 |
|
| [@DivyaShreeS09](https://github.com/DivyaShreeS09) | 1 |
|
| [@divyanshim27](https://github.com/divyanshim27) | 1 |
|
| [@divyanshisrivastava395](https://github.com/divyanshisrivastava395) | 1 |
@@ -188,4 +190,3 @@ We want to thank all the amazing contributors who have helped make TermUI what i
|
| [@LalithMadhav-CODING](https://github.com/LalithMadhav-CODING) | 1 |
|
| [@sahare77](https://github.com/sahare77) | 1 |
|
| [@maheshshinde9100](https://github.com/maheshshinde9100) | 1 |
-|
| [@manasvi-sahare](https://github.com/manasvi-sahare) | 1 |
diff --git a/packages/create-termui-app/src/index.ts b/packages/create-termui-app/src/index.ts
index 1d921925a..799f7cf38 100644
--- a/packages/create-termui-app/src/index.ts
+++ b/packages/create-termui-app/src/index.ts
@@ -4,7 +4,7 @@
import { dirname, resolve, join } from 'node:path';
import { fileURLToPath } from 'node:url';
-import { mkdirSync, writeFileSync, existsSync, readFileSync } from 'node:fs';
+import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync } from 'node:fs';
import { getBuiltinThemeNames } from '@termuijs/tss';
import { textPrompt, selectPrompt, multiSelectPrompt } from './prompts.js';
import { generateProject, type ProjectConfig } from './templates.js';
@@ -122,6 +122,17 @@ async function runProjectScaffold(args: CliArgs): Promise {
// ── Generate project ──
const projectDir = resolve(process.cwd(), projectName);
if (existsSync(projectDir)) {
+ try {
+ const entries = fs.readdirSync(projectDir);
+ const hasContent = entries.some(e => e !== '.git');
+ if (hasContent) {
+ console.log(`\n ✖ Directory "${projectName}" is not empty. Refusing to overwrite.\n`);
+ console.log(` Remove the directory or choose a different name.\n`);
+ return;
+ }
+ } catch {
+ // readdirSync failed — let the write calls fail naturally
+ }
console.log(`\n ⚠ Directory "${projectName}" already exists. Files may be overwritten.\n`);
}