You've already forked gnatdashboard
mirror of
https://github.com/AdaCore/gnatdashboard.git
synced 2026-02-12 12:30:42 -08:00
Also upgrade other dependencies such as the latest and greatest Webpack. Refactor sources to comply to the coding style in order to have a clean run for tests. Change-Id: Ic10271c92c4b8c4b7991acfb28670d80b03a1f2b
32 lines
738 B
JavaScript
32 lines
738 B
JavaScript
/**
|
|
* @author: @AngularClass
|
|
*/
|
|
var path = require('path');
|
|
|
|
const EVENT = process.env.npm_lifecycle_event || '';
|
|
|
|
// Helper functions
|
|
var ROOT = path.resolve(__dirname, '..');
|
|
|
|
function hasProcessFlag(flag) {
|
|
return process.argv.join('').indexOf(flag) > -1;
|
|
}
|
|
|
|
function hasNpmFlag(flag) {
|
|
return EVENT.includes(flag);
|
|
}
|
|
|
|
function isWebpackDevServer() {
|
|
return process.argv[1] && !! (/webpack-dev-server/.exec(process.argv[1]));
|
|
}
|
|
|
|
var root = path.join.bind(path, ROOT);
|
|
var build = path.join.bind(
|
|
path, process.env.BUILD_DIR ? process.env.BUILD_DIR : ROOT);
|
|
|
|
exports.hasProcessFlag = hasProcessFlag;
|
|
exports.hasNpmFlag = hasNpmFlag;
|
|
exports.isWebpackDevServer = isWebpackDevServer;
|
|
exports.root = root;
|
|
exports.build = build;
|