@icarusmx/creta 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +3 -1
- package/bin/creta.js +16 -2
- package/package.json +1 -1
package/bin/creta.js
CHANGED
|
@@ -235,7 +235,15 @@ function getLevelDescription(level) {
|
|
|
235
235
|
|
|
236
236
|
function isInCretaProject() {
|
|
237
237
|
// Check if we're in a Creta project by looking for key files
|
|
238
|
-
|
|
238
|
+
let currentDir
|
|
239
|
+
try {
|
|
240
|
+
currentDir = process.cwd()
|
|
241
|
+
} catch (error) {
|
|
242
|
+
// If we can't get the current directory, we're definitely not in a Creta project
|
|
243
|
+
console.error('Error: No se puede acceder al directorio actual. Asegúrate de estar en un directorio válido.')
|
|
244
|
+
return false
|
|
245
|
+
}
|
|
246
|
+
|
|
239
247
|
const packageJsonPath = path.join(currentDir, 'package.json')
|
|
240
248
|
const layoutPath = path.join(currentDir, 'src/routes/+layout.svelte')
|
|
241
249
|
const pagePath = path.join(currentDir, 'src/routes/+page.svelte')
|
|
@@ -259,7 +267,13 @@ async function unstuckProject(level) {
|
|
|
259
267
|
console.log(`📚 Agregando código para: ${getLevelDescription(level)}`)
|
|
260
268
|
|
|
261
269
|
try {
|
|
262
|
-
|
|
270
|
+
let currentDir
|
|
271
|
+
try {
|
|
272
|
+
currentDir = process.cwd()
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error('Error: No se puede acceder al directorio actual. Asegúrate de estar en un directorio válido.')
|
|
275
|
+
process.exit(1)
|
|
276
|
+
}
|
|
263
277
|
const layoutPath = path.join(currentDir, 'src/routes/+layout.svelte')
|
|
264
278
|
const pagePath = path.join(currentDir, 'src/routes/+page.svelte')
|
|
265
279
|
|