-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsrc2build.js
43 lines (31 loc) · 1.38 KB
/
src2build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*!
* Project: roulette-predictor
* File: ./gulp-tasks/sync/src2build.js
* Copyright(c) [2018-present] <tbaltrushaitis@gmail.com>
* License: MIT
*/
'use strict';
// ------------------------------------------------------------------------ //
// ----------------------------- DEPENDENCIES --------------------------- //
// ------------------------------------------------------------------------ //
const path = require('path');
const util = require('util');
const utin = util.inspect;
const dirSync = require('gulp-directory-sync');
/**
* CONFIGURATION
*/
let ME = global.ME || {};
const modName = path.basename(module.filename, '.js');
const modPath = path.relative(ME.WD, path.dirname(module.filename));
const modConfigFile = `config/${path.join(modPath, modName)}.json`;
const modConfig = require('read-config')(modConfigFile);
// ------------------------------------------------------------------------ //
// ------------------------------- EXPORTS ------------------------------ //
// ------------------------------------------------------------------------ //
module.exports = function (gulp) {
console.log(`[${new Date().toISOString()}][${modPath}/${modName}] ACTIVATED with modConfig = [${utin(modConfig)}]`);
return gulp.src('')
.pipe(dirSync(ME.SRC, ME.BUILD, ME.pkg.options.sync))
.on('error', console.error.bind(console));
};