@icarusmx/creta 0.4.0 → 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.
@@ -0,0 +1,11 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(//private/tmp/**)",
5
+ "Bash(node:*)",
6
+ "WebFetch(domain:github.com)"
7
+ ],
8
+ "deny": [],
9
+ "ask": []
10
+ }
11
+ }
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
- const currentDir = process.cwd()
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
- const currentDir = process.cwd()
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {