exec.js 842 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. 'use strict';
  6. var combo = require('./combo'),
  7. themes = require('../tools/files-router').get('themes'),
  8. _ = require('underscore');
  9. var themeOptions = {};
  10. _.each(themes, function(theme, name) {
  11. themeOptions[name] = {
  12. cmd: combo.collector.bind(combo, name)
  13. };
  14. });
  15. var execOptions = {
  16. all : {
  17. cmd: function () {
  18. var cmdPlus = (/^win/.test(process.platform) == true) ? ' & ' : ' && ',
  19. command;
  20. command = _.map(themes, function(theme, name) {
  21. return combo.collector(name);
  22. }).join(cmdPlus);
  23. return 'echo ' + command;
  24. }
  25. }
  26. };
  27. /**
  28. * Execution into cmd
  29. */
  30. module.exports = _.extend(themeOptions, execOptions);