mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Copy apm in Mac Resources folder
This commit is contained in:
parent
18c20c095f
commit
f5c6baa064
@ -10,9 +10,11 @@ const appMetadata = require('../package.json')
|
||||
const repositoryRootPath = path.resolve(__dirname, '..')
|
||||
const buildOutputPath = path.join(repositoryRootPath, 'out')
|
||||
const intermediateAppPath = path.join(buildOutputPath, 'app')
|
||||
const intermediateResourcesPath = path.join(buildOutputPath, 'resources')
|
||||
const cachePath = path.join(repositoryRootPath, 'cache')
|
||||
|
||||
module.exports = {
|
||||
appMetadata,
|
||||
repositoryRootPath, buildOutputPath, intermediateAppPath, cachePath
|
||||
repositoryRootPath, buildOutputPath, intermediateAppPath, intermediateResourcesPath,
|
||||
cachePath
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ const glob = require('glob')
|
||||
|
||||
module.exports = function () {
|
||||
console.log(`Copying assets to ${CONFIG.intermediateAppPath}...`);
|
||||
const ignoredPathsRegExp = buildIgnoredPathsRegExp()
|
||||
const skipIgnoredPaths = (path) => !ignoredPathsRegExp.test(path)
|
||||
let srcPaths = [
|
||||
path.join(CONFIG.repositoryRootPath, 'dot-atom'),
|
||||
path.join(CONFIG.repositoryRootPath, 'exports'),
|
||||
@ -22,13 +24,18 @@ module.exports = function () {
|
||||
path.join(CONFIG.repositoryRootPath, 'vendor')
|
||||
]
|
||||
srcPaths = srcPaths.concat(glob.sync(path.join(CONFIG.repositoryRootPath, 'spec', '*.*'), {ignore: path.join('**', '*-spec.*')}))
|
||||
const ignoredPathsRegExp = buildIgnoredPathsRegExp()
|
||||
for (let srcPath of srcPaths) {
|
||||
fs.copySync(
|
||||
srcPath,
|
||||
computeDestinationPath(srcPath),
|
||||
{filter: (path) => !ignoredPathsRegExp.test(path)}
|
||||
)
|
||||
fs.copySync(srcPath, computeDestinationPath(srcPath), {filter: skipIgnoredPaths})
|
||||
}
|
||||
|
||||
console.log(`Copying resources to ${CONFIG.intermediateResourcesPath}...`);
|
||||
fs.copySync(
|
||||
path.join(CONFIG.repositoryRootPath, 'apm', 'node_modules', 'atom-package-manager'),
|
||||
path.join(CONFIG.intermediateResourcesPath, 'apm'),
|
||||
{filter: skipIgnoredPaths}
|
||||
)
|
||||
if (process.platform !== 'windows') {
|
||||
fs.copySync(path.join(CONFIG.repositoryRootPath, 'atom.sh'), path.join(CONFIG.intermediateResourcesPath, 'atom.sh'))
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +49,12 @@ function buildIgnoredPathsRegExp () {
|
||||
escapeRegExp(path.join('git-utils', 'deps')),
|
||||
escapeRegExp(path.join('oniguruma', 'deps')),
|
||||
escapeRegExp(path.join('less', 'dist')),
|
||||
escapeRegExp(path.join('npm', 'doc')),
|
||||
escapeRegExp(path.join('npm', 'html')),
|
||||
escapeRegExp(path.join('npm', 'man')),
|
||||
escapeRegExp(path.join('npm', 'node_modules', '.bin', 'beep')),
|
||||
escapeRegExp(path.join('npm', 'node_modules', '.bin', 'clear')),
|
||||
escapeRegExp(path.join('npm', 'node_modules', '.bin', 'starwars')),
|
||||
escapeRegExp(path.join('pegjs', 'examples')),
|
||||
escapeRegExp(path.join('get-parameter-names', 'node_modules', 'testla')),
|
||||
escapeRegExp(path.join('get-parameter-names', 'node_modules', '.bin', 'testla')),
|
||||
|
@ -7,6 +7,7 @@
|
||||
// other than transpilation. It looks like it has a programmatic API. We'll need to
|
||||
// copy more stuff such as the package.json for the packager to work correctly.
|
||||
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
const electronPackager = require('electron-packager')
|
||||
|
||||
@ -29,6 +30,17 @@ module.exports = function () {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
} else {
|
||||
if (appPaths.length > 1) {
|
||||
throw new Error('TODO: handle this case!')
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
const bundleResourcesPath = path.join(appPaths[0], 'Atom.app', 'Contents', 'Resources')
|
||||
fs.copySync(CONFIG.intermediateResourcesPath, path.join(bundleResourcesPath, 'app'))
|
||||
} else {
|
||||
throw new Error('TODO: handle this case!')
|
||||
}
|
||||
|
||||
console.log(`Application bundle(s) created on ${appPaths}`)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user