fix(core): update

This commit is contained in:
Philipp Kunz 2019-10-03 00:00:20 +02:00
parent 5a3befe5af
commit 7275a858d6

View File

@ -52,17 +52,19 @@ export class NpmciGitManager {
// remove old mirrors // remove old mirrors
await bashNoError('git remote rm mirror'); await bashNoError('git remote rm mirror');
await bash(`git fetch`);
// add the mirror // add the mirror
await bash( await bash(
`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git` `git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`
); );
await bash(`git fetch`);
await bash(`git push mirror --all`); await bash(`git push mirror --all`);
await bash(`git checkout master`); await bash(`git checkout origin/master`);
await bash(`git push mirror master`); await bash(`git push mirror master`);
logger.log('ok', 'pushed all branches to mirror!'); logger.log('ok', 'pushed all branches to mirror!');
await bash(`git push mirror --tags`); await bash(`git push mirror --tags`);
logger.log('ok', 'pushed all tags to mirror!'); logger.log('ok', 'pushed all tags to mirror!');
// remove old mirrors
await bashNoError('git remote rm mirror');
} else { } else {
logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`); logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
process.exit(1); process.exit(1);