rook-cli 1.2.1 → 1.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rook-cli",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "CLI para instalar componentes Shopify",
5
5
  "repository": {
6
6
  "type": "git",
package/src/mcp/server.js CHANGED
@@ -228,12 +228,19 @@ async function handleGenerateScaffold(args) {
228
228
 
229
229
  // Grava no disco
230
230
  const diretorioAtual = process.cwd();
231
- const destDir = path.join(diretorioAtual, arquivo.outputDir);
232
- const destPath = path.join(destDir, arquivo.fileName);
231
+
232
+ // Garantimos que o caminho seja relativo à pasta onde o comando foi chamado
233
+ // Evita erro de permissão ao tentar criar pastas na raiz do sistema (/)
234
+ const destDir = path.resolve(diretorioAtual, './' + arquivo.outputDir);
235
+ const destPath = path.resolve(destDir, './' + arquivo.fileName);
233
236
  const caminhoRelativo = path.join(arquivo.outputDir, arquivo.fileName);
234
237
 
235
- await fs.ensureDir(destDir);
236
- await fs.writeFile(destPath, arquivo.content, 'utf-8');
238
+ try {
239
+ await fs.ensureDir(destDir);
240
+ await fs.writeFile(destPath, arquivo.content, 'utf-8');
241
+ } catch (fsErro) {
242
+ throw new Error(`Falha ao gravar arquivo em "${destDir}": ${fsErro.message}. Verifique as permissões de escrita.`);
243
+ }
237
244
 
238
245
  return {
239
246
  content: [{
@@ -49,7 +49,7 @@ export class Logger {
49
49
  banner() {
50
50
  console.log('');
51
51
  console.log(pc.bold(pc.white(' ╔══════════════════════════════╗')));
52
- console.log(pc.bold(pc.white(' ║ ♟️ ROOK CLI v1.2.1 ║')));
52
+ console.log(pc.bold(pc.white(' ║ ♟️ ROOK CLI v1.3.0 ║')));
53
53
  console.log(pc.bold(pc.white(' ║ Shopify Component Tool ║')));
54
54
  console.log(pc.bold(pc.white(' ╚══════════════════════════════╝')));
55
55
  console.log('');