create-genia-mission-control 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/lib/setup.js +8 -2
  2. package/package.json +1 -1
package/lib/setup.js CHANGED
@@ -9,12 +9,18 @@ const GENIA_OS_REPO = 'https://github.com/elidyizzy/GENIA-SQUAD-OS.git';
9
9
  export async function setupGenieOS(projectDir, businessDir) {
10
10
  await fs.ensureDir(projectDir);
11
11
 
12
- // Clonar GENIA-SQUAD-OS
12
+ // Clonar GENIA-SQUAD-OS para diretório temporário e mesclar
13
+ // (projectDir pode já ter .business/ criado pelo segundo-cérebro)
14
+ const tempDir = projectDir + '__tmp__';
13
15
  const spinner = ora('Clonando GEN.IA SQUAD OS...').start();
14
16
  try {
15
- await execa('git', ['clone', GENIA_OS_REPO, '.'], { cwd: projectDir });
17
+ await fs.remove(tempDir); // garantir limpeza de tentativas anteriores
18
+ await execa('git', ['clone', GENIA_OS_REPO, tempDir]);
19
+ await fs.copy(tempDir, projectDir, { overwrite: false });
20
+ await fs.remove(tempDir);
16
21
  spinner.succeed(ui.ok('GEN.IA SQUAD OS clonado'));
17
22
  } catch (err) {
23
+ await fs.remove(tempDir).catch(() => {});
18
24
  spinner.fail(ui.fail('Erro ao clonar GENIA-SQUAD-OS'));
19
25
  throw err;
20
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-genia-mission-control",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Instalador do GEN.IA Mission Control — um comando para ter seu time de agentes IA funcionando",
5
5
  "bin": {
6
6
  "create-genia-mission-control": "bin/index.js"