zoro-cli
Version:
49 lines (37 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.copyConfigs = copyConfigs;
var _bluebird = require('bluebird');
var _bluebird2 = _interopRequireDefault(_bluebird);
var _handlePath = require('./handlePath');
var _handlePath2 = _interopRequireDefault(_handlePath);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function copyConfigs() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var lib = options.lib,
atool = options.atool,
override = options.override;
var configs = ['.editorconfig', '.eslintignore', '.eslintrc.json', {
from: 'gitignore',
to: '.gitignore'
}, '.prettierignore', '.stylelintignore', '.stylelintrc.json', 'jsconfig.json', 'lint-staged.config.js'];
if (lib) {
configs.push({
from: 'npmignore',
to: '.npmignore'
});
configs.push('.babelrc');
}
if (atool) {
configs.push({ from: 'postcss.config.atool.js', to: 'postcss.config.js' }, { from: 'webpack.config.atool.js', to: 'webpack.config.js' });
} else {
configs.push('postcss.config.js', 'webpack.config.js');
}
_bluebird2.default.each(configs, function (file) {
return (0, _handlePath2.default)({ file: file, override: override });
}).then(function () {
console.log('done');
}).catch(console.err);
}