index.js 666 B

1234567891011121314151617181920212223
  1. // Dependecies.
  2. const publisher = require('./publisher');
  3. // CMD Arguments Management.
  4. const doNotBuild = process.argv.indexOf('--no-build') === -1;
  5. const doNotPublish = process.argv.indexOf('--no-publish') === -1;
  6. /**
  7. * Main function driving the publication.
  8. */
  9. function main() {
  10. // Gets the current npm user.
  11. console.log("Using npm user:");
  12. let loginCheck = shelljs.exec('npm whoami');
  13. // If logged in process.
  14. if (loginCheck.code === 0) {
  15. publisher.process(doNotBuild, doNotPublish, true);
  16. }
  17. // If not logged in error.
  18. else {
  19. console.log('Not logged in, please log in to npm.');
  20. }
  21. }();