Browse Source

refactor: push script

pull/1884/head
mehmet-erim 7 years ago
parent
commit
f39ed0ec11
  1. 6
      npm/ng-packs/scripts/push.js

6
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);

Loading…
Cancel
Save