From 8a58c2289f87066100198abbae935d2c85f511b3 Mon Sep 17 00:00:00 2001 From: 0xBunzy Date: Mon, 18 Nov 2024 14:14:11 -0800 Subject: [PATCH] cursor file fixed --- src/bin/script.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/bin/script.ts b/src/bin/script.ts index d1f2949..c6450f5 100644 --- a/src/bin/script.ts +++ b/src/bin/script.ts @@ -267,13 +267,21 @@ async function init() { const targetCursorRulesPath = path.join(root, ".cursorrules"); if (fs.existsSync(cursorRulesPath)) { - fs.copyFileSync(cursorRulesPath, targetCursorRulesPath); + const cursorRulesContent = fs.readFileSync(cursorRulesPath, "utf8"); + fs.writeFileSync(targetCursorRulesPath, cursorRulesContent); console.log( - `${pc.green("✓")} Added .cursorrules file for Cursor.ai integration` + `${pc.green( + "✓" + )} Added template-specific .cursorrules file for Cursor.ai integration` ); + } else { + console.warn(`No .cursorrules file found for ${variant} template`); } } catch (error) { - console.warn("Failed to copy .cursorrules file:", error); + console.warn( + `Failed to copy .cursorrules file for ${variant} template:`, + error + ); } } else { console.log(`${pc.yellow("⚠")} Adding .cursorrules file skipped`);