Use path.join instead of manually creating paths

This commit is contained in:
Antonio Scandurra
2016-07-27 16:39:53 +02:00
parent c4c12c2e1d
commit 6903e941d9
3 changed files with 7 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ module.exports = function () {
path.join(CONFIG.repositoryRootPath, 'src'),
path.join(CONFIG.repositoryRootPath, 'vendor')
]
srcPaths.concat(glob.sync(path.join(CONFIG.repositoryRootPath, 'spec', '*.*'), {ignore: '**/*-spec.*'}))
srcPaths.concat(glob.sync(path.join(CONFIG.repositoryRootPath, 'spec', '*.*'), {ignore: path.join('**', '*-spec.*')}))
for (let srcPath of srcPaths) {
fs.copySync(srcPath, computeDestinationPath(srcPath))
}

View File

@@ -32,9 +32,9 @@ function transpileBabelPaths () {
function getPathsToTranspile () {
let paths = []
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/src/**/*.js`))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'src', '**', '*.js')))
for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) {
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/node_modules/${packageName}/**/*.js`))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.js')))
}
return paths
}

View File

@@ -6,7 +6,6 @@
const coffee = require('coffee-script')
const fs = require('fs')
const glob = require('glob')
const mkdirp = require('mkdirp')
const path = require('path')
const CONFIG = require('../config')
@@ -21,11 +20,11 @@ function transpileCoffeeScriptPaths () {
function getPathsToTranspile () {
let paths = []
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/src/**/*.coffee`))
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/spec/*.coffee`, {ignore: '**/*-spec.coffee'}))
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/exports/**/*.coffee`))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'src', '**', '*.coffee')))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'spec', '*.coffee')))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'exports', '**', '*.coffee')))
for (let packageName of Object.keys(CONFIG.appMetadata.packageDependencies)) {
paths = paths.concat(glob.sync(`${CONFIG.electronAppPath}/node_modules/${packageName}/**/*.coffee`))
paths = paths.concat(glob.sync(path.join(CONFIG.electronAppPath, 'node_modules', packageName, '**', '*.coffee')))
}
return paths
}