Files
atom/build/lib/copy-assets.js
Antonio Scandurra 59d995b21d Transpile CSON
2016-07-27 16:53:38 +02:00

29 lines
1.0 KiB
JavaScript

// This module exports a function that copies all the static assets into the
// appropriate location in the build output directory.
'use strict'
const path = require('path')
const fs = require('fs-extra')
const computeDestinationPath = require('./compute-destination-path')
const CONFIG = require('../config')
const glob = require('glob')
module.exports = function () {
console.log('Copying assets...');
const srcPaths = [
path.join(CONFIG.repositoryRootPath, 'dot-atom'),
path.join(CONFIG.repositoryRootPath, 'exports'),
path.join(CONFIG.repositoryRootPath, 'keymaps'),
path.join(CONFIG.repositoryRootPath, 'menus'),
path.join(CONFIG.repositoryRootPath, 'node_modules'),
path.join(CONFIG.repositoryRootPath, 'static'),
path.join(CONFIG.repositoryRootPath, 'src'),
path.join(CONFIG.repositoryRootPath, 'vendor')
]
srcPaths.concat(glob.sync(path.join(CONFIG.repositoryRootPath, 'spec', '*.*'), {ignore: path.join('**', '*-spec.*')}))
for (let srcPath of srcPaths) {
fs.copySync(srcPath, computeDestinationPath(srcPath))
}
}