Skip to content

Instantly share code, notes, and snippets.

@qodunpob
Created August 2, 2018 06:05
Show Gist options
  • Save qodunpob/0943804c395a67f55234dc4cb95939e2 to your computer and use it in GitHub Desktop.
Save qodunpob/0943804c395a67f55234dc4cb95939e2 to your computer and use it in GitHub Desktop.
/* temporary directory for the builds repository */
const tempDir = join(rootDir, 'temp');
if (existsSync(tempDir)) {
spawnSync('rm', ['-rf', 'temp'], getSpawnOptions(rootDir));
}
mkdirSync(tempDir);
/* getting parameters from the package.json */
const { name, version, repository } = require(join(rootDir, 'package.json'));
const originUrl = repository.url.replace(`${name}-source`, name);
spawnSync('git', ['init'], getSpawnOptions(tempDir));
spawnSync('git', ['remote', 'add', 'origin', originUrl], getSpawnOptions(tempDir));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment