mirror of
https://github.com/atom/atom.git
synced 2026-02-08 21:55:05 -05:00
We need to do this so we can transpile everything in place, but then we should be able to run electron-packager directly on this directory.
33 lines
1.2 KiB
JavaScript
33 lines
1.2 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 CONFIG = require('../config')
|
|
const glob = require('glob')
|
|
|
|
module.exports = function () {
|
|
console.log(`Copying assets to ${CONFIG.intermediateAppPath}...`);
|
|
let 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 = srcPaths.concat(glob.sync(path.join(CONFIG.repositoryRootPath, 'spec', '*.*'), {ignore: path.join('**', '*-spec.*')}))
|
|
for (let srcPath of srcPaths) {
|
|
fs.copySync(srcPath, computeDestinationPath(srcPath))
|
|
}
|
|
}
|
|
|
|
function computeDestinationPath (srcPath) {
|
|
const relativePath = path.relative(CONFIG.repositoryRootPath, srcPath)
|
|
return path.join(CONFIG.intermediateAppPath, relativePath)
|
|
}
|