buildsight-collector 1.0.0 → 1.0.1

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/index.js +10 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -48,23 +48,26 @@ async function main() {
48
48
  console.log(chalk.gray(`Buscando commits desde: ${sinceDate.toISOString()}`));
49
49
  // Atualizar repositório antes de buscar commits
50
50
  try {
51
- // Use spawn with stdio: 'inherit' so the user can interact (enter credentials) if git requests them.
52
- spinner.start('Atualizando repositório (git pull)...');
51
+ spinner.start('Atualizando referências remotas (git fetch --all)...');
53
52
  await new Promise((resolve, reject) => {
54
- const p = spawn('git', ['pull'], { cwd: repo.path, stdio: 'inherit' });
53
+ const p = spawn('git', ['fetch', '--all'], {
54
+ cwd: repo.path,
55
+ stdio: 'inherit' // permite interação (senha, passphrase, etc.)
56
+ });
55
57
  p.on('error', (err) => reject(err));
56
58
  p.on('close', (code) => {
57
59
  if (code === 0) resolve();
58
- else reject(new Error(`git pull exited with code ${code}`));
60
+ else reject(new Error(`git fetch --all exited with code ${code}`));
59
61
  });
60
62
  });
61
- spinner.succeed('Repositório atualizado.');
62
- } catch (pullErr) {
63
- spinner.warn('Não foi possível atualizar o repositório (git pull). Usando dados locais.');
63
+ spinner.succeed('Referências remotas atualizadas.');
64
+ } catch (fetchErr) {
65
+ spinner.warn('Não foi possível atualizar referências remotas (git fetch --all). Usando dados locais.');
64
66
  }
65
67
 
66
68
  // --- 🔹 1. Commits detalhados ---
67
69
  const log = await git.log({
70
+ '--all': null,
68
71
  '--since': sinceDate.toISOString(),
69
72
  '--stat': null, // inclui dados de arquivos alterados
70
73
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildsight-collector",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI do BuildSight para coleta automatizada de commits e métricas de repositórios.",
5
5
  "main": "index.js",
6
6
  "bin": {