123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- 'use strict';
- var theme = require('../tools/files-router').get('themes'),
- path = require('./path');
- /**
- * Define Combos for repetitive code.
- */
- module.exports = {
- collector: function (themeName) {
- var cmdPlus = /^win/.test(process.platform) ? ' & ' : ' && ',
- command = 'grunt --force clean:' + themeName + cmdPlus;
- command = command + 'php bin/magento dev:source-theme:deploy ' +
- theme[themeName].files.join(' ') +
- ' --type=less' +
- ' --locale=' + theme[themeName].locale +
- ' --area=' + theme[themeName].area +
- ' --theme=' + theme[themeName].name;
- return command;
- },
- autopath: function (themeName, folder) {
- return folder +
- theme[themeName].area + '/' +
- theme[themeName].name + '/' +
- theme[themeName].locale + '/';
- },
- lessFiles: function (themeName) {
- var lessStringArray = [],
- cssStringArray = [],
- lessFiles = {},
- i = 0;
- for (i; i < theme[themeName].files.length; i++) {
- cssStringArray[i] = path.pub +
- theme[themeName].area + '/' +
- theme[themeName].name + '/' +
- theme[themeName].locale + '/' +
- theme[themeName].files[i] + '.css';
- lessStringArray[i] = path.pub +
- theme[themeName].area + '/' +
- theme[themeName].name + '/' +
- theme[themeName].locale + '/' +
- theme[themeName].files[i] + '.less';
- lessFiles[cssStringArray[i]] = lessStringArray[i];
- }
- return lessFiles;
- }
- };
|