You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/npm/ng-packs/scripts/push.ts

20 lines
613 B

const Confirm = require('prompt-confirm');
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', remote, branch], { stdout: 'inherit' });
await execa('git', ['fetch', remote], { stdout: 'inherit' });
console.log('Successfully!');
} catch (error) {
console.log('An error occured.' + error);
}
}
})();