Ejemplo n.º 1
0
async function readGitModules(dirPath) {
  const modules = [];

  for (const dir of fs.readdirSync(dirPath)) {
    const modulePath = `${dirPath}/${dir}`;
    const repo = await execa.stdout('git', ['config', '--get', 'remote.origin.url'], { cwd: modulePath });
    const sha = await execa.stdout('git', ['rev-parse', 'HEAD'], { cwd: modulePath });

    modules.push({ repo, sha });
  }

  return modules;
}
Ejemplo n.º 2
0
async function extract({ packages }) {
  for (const pkg of packages) {
    if (pkg.disable) {
      return pkg
    }

    const stdout = await execa.stdout('dpkg', ['-s', pkg.name])
      .split('\n')
      .find(line => line.startsWith('Version'));

    pkg.version = stdout ? stdout.split(' ')[1] : undefined;
  }

  return { packages };
}