From 7275a858d63cc6ae3f76c8c473968476ee9afd08 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 3 Oct 2019 00:00:20 +0200 Subject: [PATCH] fix(core): update --- ts/manager.git/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ts/manager.git/index.ts b/ts/manager.git/index.ts index 45a8471..b0feae9 100644 --- a/ts/manager.git/index.ts +++ b/ts/manager.git/index.ts @@ -52,17 +52,19 @@ export class NpmciGitManager { // remove old mirrors await bashNoError('git remote rm mirror'); + await bash(`git fetch`); // add the mirror await bash( `git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git` ); - await bash(`git fetch`); await bash(`git push mirror --all`); - await bash(`git checkout master`); + await bash(`git checkout origin/master`); await bash(`git push mirror master`); logger.log('ok', 'pushed all branches to mirror!'); await bash(`git push mirror --tags`); logger.log('ok', 'pushed all tags to mirror!'); + // remove old mirrors + await bashNoError('git remote rm mirror'); } else { logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`); process.exit(1);