1
0
Fork 0
peertube/client/config/helpers.js
2016-09-06 22:40:57 +02:00

22 lines
555 B
JavaScript

const path = require('path')
const ROOT = path.resolve(__dirname, '..')
console.log('root directory:', root() + '\n')
function hasProcessFlag (flag) {
return process.argv.join('').indexOf(flag) > -1
}
function isWebpackDevServer () {
return process.argv[1] && !!(/webpack-dev-server$/.exec(process.argv[1]))
}
function root (args) {
args = Array.prototype.slice.call(arguments, 0)
return path.join.apply(path, [ROOT].concat(args))
}
exports.hasProcessFlag = hasProcessFlag
exports.isWebpackDevServer = isWebpackDevServer
exports.root = root