blob: d5a4d2ef30d2c5f1e72f1bf50295a8045c0a1093 [file] [log] [blame]
Max Chu3c8b65f2017-07-19 17:47:59 -07001'use strict';
2
3const path = require('path');
4const gutil = require('gulp-util');
5
6exports.ngModule = 'app';
7
8exports.paths = {
9 src: 'src',
10 dist: 'dist/extensions/metro-net-gui',
11 appConfig: 'conf/app',
12 tmp: '.tmp',
13 e2e: 'e2e',
14 tasks: 'gulp_tasks'
15
16};
17
18exports.path = {};
19for (const pathName in exports.paths) {
20 if (exports.paths.hasOwnProperty(pathName)) {
21 exports.path[pathName] = function pathJoin() {
22 const pathValue = exports.paths[pathName];
23 const funcArgs = Array.prototype.slice.call(arguments);
24 const joinArgs = [pathValue].concat(funcArgs);
25 return path.join.apply(this, joinArgs);
26 };
27 }
28}
29
30/**
31 * Common implementation for an error handler of a Gulp plugin
32 */
33exports.errorHandler = function (title) {
34 return function (err) {
35 gutil.log(gutil.colors.red(`[${title}]`), err.toString());
36 this.emit('end');
37 };
38};