Skip to content

Commit 444e2f2

Browse files
authored
gitignore (#18)
1 parent 1e16469 commit 444e2f2

File tree

11 files changed

+1724
-2
lines changed

11 files changed

+1724
-2
lines changed

index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const LANGUAGES: Record<LanguageKey, LanguageInfo> = {
4949
const TEMPLATES: Record<TemplateKey, TemplateInfo> = {
5050
[TEMPLATE_SAMPLE_APP]: {
5151
name: "Sample App",
52-
description: "Extracts page title using Playwright",
52+
description: "Implements basic Kernel apps",
5353
languages: [LANGUAGE_TYPESCRIPT, LANGUAGE_PYTHON],
5454
},
5555
[TEMPLATE_BROWSER_USE]: {
@@ -292,7 +292,20 @@ function copyTemplateFiles(
292292
throw new Error(`Template not found: ${templatePath}`);
293293
}
294294

295-
fs.copySync(templatePath, appPath);
295+
// Copy all files and handle _gitignore specially
296+
fs.copySync(templatePath, appPath, {
297+
filter: (src, dest) => {
298+
const filename = path.basename(src);
299+
if (filename === '_gitignore') {
300+
console.log("Copying _gitignore");
301+
fs.copyFileSync(src, dest);
302+
// Rename it to .gitignore
303+
fs.renameSync(dest, path.join(path.dirname(dest), '.gitignore'));
304+
return false; // Skip the original copy since we handled it
305+
}
306+
return true; // Copy all other files normally
307+
}
308+
});
296309
}
297310

298311
// Set up project dependencies based on language
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

templates/typescript/sample-app/package-lock.json

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)