Skip to content

Instantly share code, notes, and snippets.

@wgbn
Created October 24, 2019 16:08
Show Gist options
  • Select an option

  • Save wgbn/f4335ffd10eb7e017c2eaad549e982cf to your computer and use it in GitHub Desktop.

Select an option

Save wgbn/f4335ffd10eb7e017c2eaad549e982cf to your computer and use it in GitHub Desktop.
const prompt = require("prompt");
const { exec } = require('child_process');
prompt.start();
console.log('Digite a versão do commit:');
prompt.get(['version'], function (erro, result) {
if (erro) return;
const hoje = new Date();
exec(`git add www -f && git commit -m build-${hoje.getFullYear()}${hoje.getMonth()+1}${hoje.getDate()}-${result.version || ''} && git push deploy`, (err, stdout, stderr) => {
if (err) return;
console.log(stdout);
console.log(`stderr: ${stderr}`);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment