1 |
|
2 |
|
3 |
|
4 |
|
5 | "use strict";
|
6 |
|
7 | var argx = require('argx'),
|
8 | async = require('async'),
|
9 | path = require('path'),
|
10 | pkg = require('./package.json'),
|
11 | compiling = require('apeman-commons-compiling'),
|
12 | logging = require('apeman-commons-logging'),
|
13 | objnest = require('objnest');
|
14 |
|
15 |
|
16 | function apemanUiContribAngularStoraging(options) {
|
17 | var args = argx(arguments);
|
18 | options = objnest.expand(args.pop('object') || {});
|
19 |
|
20 | return function dist(context, callback) {
|
21 |
|
22 | if (typeof context == 'string') {
|
23 | context = {dest: context}
|
24 | }
|
25 |
|
26 | var logger = context.logger || logging.apemanUiLogger({name: pkg.name}),
|
27 | dest = context.dest || 'apeman_ui_components';
|
28 |
|
29 | if (logger.verbose) {
|
30 | logger.printConfig({});
|
31 | }
|
32 |
|
33 | async.series([
|
34 | function (callback) {
|
35 | var filename = path.resolve(dest, pkg.name + '.js');
|
36 | compiling.concatFiles([
|
37 | path.resolve(__dirname, 'assets/src/module.js'),
|
38 | path.resolve(__dirname, 'assets/src/**/*.js')
|
39 | ], filename, {
|
40 | unique: true,
|
41 | log: true
|
42 | }, callback);
|
43 | }
|
44 | ], callback);
|
45 | }
|
46 | }
|
47 |
|
48 | module.exports = apemanUiContribAngularStoraging;
|