From f39ed0ec117031c4c332fca80135a3cff9dfb47f Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 9 Oct 2019 09:59:07 +0300 Subject: [PATCH] refactor: push script --- npm/ng-packs/scripts/push.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/scripts/push.js b/npm/ng-packs/scripts/push.js index 08162f35ee..6c41b0b697 100644 --- a/npm/ng-packs/scripts/push.js +++ b/npm/ng-packs/scripts/push.js @@ -4,9 +4,13 @@ const execa = require('execa'); (async () => { const answer = await new Confirm('Would you like to push?').run().then(answer => answer); + const remote = execa.sync('git', ['remote']).stdout; + const branch = execa.sync('git', ['rev-parse', '--abbrev-ref', 'HEAD']).stdout; + if (answer) { try { - await execa('git', ['push'], { stdout: 'inherit' }); + await execa('git', ['push', remote, branch], { stdout: 'inherit' }); + await execa('git', ['fetch', remote], { stdout: 'inherit' }); console.log('Successfully!'); } catch (error) { console.log('An error occured.' + error);