Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

prepareSpec.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const path = require('path');
  2. const fs = require('fs-extra');
  3. const spawn = require('cross-spawn');
  4. console.info('Removing any old artifacts from spec');
  5. fs.removeSync('spec/myplugin');
  6. fs.removeSync('spec/plugins');
  7. fs.removeSync('spec/platforms');
  8. const myplugin = path.join('spec', 'myplugin');
  9. console.info('Copying plugin artifacts into ' + myplugin);
  10. fs.ensureDirSync(myplugin);
  11. ['package.json', 'plugin.xml'].forEach((src) => {
  12. const dest = path.join(myplugin, src);
  13. fs.copySync(src, dest);
  14. });
  15. ['scripts', 'src', 'www'].forEach((src) => {
  16. const dest = path.join(myplugin, src);
  17. fs.ensureDirSync(dest);
  18. fs.copySync(src, dest);
  19. });
  20. const args = 'plugin add myplugin';
  21. console.log('Spawning Cordova CLI in `spec` with the following arguments: ' + args);
  22. spawn.sync('cordova', args.split(' '), {
  23. cwd: 'spec',
  24. stdio: 'inherit',
  25. });
  26. console.info('The spec is now ready to test a copy of this plugin.');
  27. console.info('Please do `cd spec` and then use `cordova platform add` to add each desired platform.');