From c0aba5d4873efc2a2e66582a8b4cfa35a62d817b Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 8 Sep 2017 15:00:43 +0200 Subject: [PATCH] fix async execution --- dist/mod_git/index.js | 10 +++++++--- ts/mod_git/index.ts | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dist/mod_git/index.js b/dist/mod_git/index.js index d61c362..c2c4d54 100644 --- a/dist/mod_git/index.js +++ b/dist/mod_git/index.js @@ -38,8 +38,12 @@ exports.mirror = () => __awaiter(this, void 0, void 0, function* () { plugins.beautylog.info('found github token.'); plugins.beautylog.log('attempting the mirror the repository to GitHub'); // add the mirror - npmci_bash_1.bash(`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`); - npmci_bash_1.bash(`git push mirror`); + yield npmci_bash_1.bash(`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`); + yield npmci_bash_1.bash(`git push mirror`); + } + else { + plugins.beautylog.error(`cannot find NPMCI_GIT_GITHUBTOKEN env var!`); + process.exit(1); } }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfZ2l0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSx5Q0FBd0M7QUFDeEMsOENBQW9DO0FBQ3BDLDRDQUFtQztBQUVuQzs7O0dBR0c7QUFDUSxRQUFBLFNBQVMsR0FBRyxDQUFPLE9BQU87SUFDbkMsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxNQUFNLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUMxQixJQUFJLE1BQU0sR0FBVyxPQUFPLENBQUMsQ0FBQyxDQUFFLENBQUMsQ0FBRSxDQUFBO1FBQ25DLE1BQU0sQ0FBQyxDQUF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BSSxnQkFBSSxDQUFDLElBQUksQ0FBQTtJQUMvRCxJQUFJLFVBQVUsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLGdCQUFnQixJQUFJLGdCQUFJLENBQUMsSUFBSSxDQUFBO0lBQzFELEVBQUUsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDaEIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMscUJBQXFCLENBQUMsQ0FBQTtRQUM3QyxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxnREFBZ0QsQ0FBQyxDQUFBO1FBQ3ZFLGlCQUFpQjtRQUNqQixNQUFNLGlCQUFJLENBQUMsaUNBQWlDLFdBQVcsZUFBZSxVQUFVLElBQUksVUFBVSxNQUFNLENBQUMsQ0FBQTtRQUNyRyxNQUFNLGlCQUFJLENBQUMsaUJBQWlCLENBQUMsQ0FBQTtJQUMvQixDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDTixPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw0Q0FBNEMsQ0FBQyxDQUFBO1FBQ3JFLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUE7SUFDakIsQ0FBQztBQUNILENBQUMsQ0FBQSxDQUFBIn0= \ No newline at end of file diff --git a/ts/mod_git/index.ts b/ts/mod_git/index.ts index fb48ca0..cf7969c 100644 --- a/ts/mod_git/index.ts +++ b/ts/mod_git/index.ts @@ -29,7 +29,10 @@ export let mirror = async () => { plugins.beautylog.info('found github token.') plugins.beautylog.log('attempting the mirror the repository to GitHub') // add the mirror - bash(`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`) - bash(`git push mirror`) + await bash(`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`) + await bash(`git push mirror`) + } else { + plugins.beautylog.error(`cannot find NPMCI_GIT_GITHUBTOKEN env var!`) + process.exit(1) } }