Skip to content

Commit

Permalink
[fix] minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
icfr committed Sep 22, 2016
1 parent d2461a9 commit f2e2476
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 31 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/*{.,-}min.js
node_modules/**/*
data/**/*
test/data/**/*
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ rules:
no-labels: 2
no-lone-blocks: 2
no-loop-func: 2
no-magic-numbers: [2,{"ignore": [0,1,-1]}]
no-magic-numbers: [2,{"ignore": [0,1,-1,2]}]
no-multi-spaces: 2
no-multi-str: 2
no-native-reassign: 2
Expand Down
3 changes: 2 additions & 1 deletion bootstrap/commands.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
/* global app,config,appdir*/
var shell = require('../lib/shell');

var each = require('lodash/each');
var includeAll = require('include-all');
var path = require('path');
require('.');
var shell = require('../lib/shell');
global.app = new shell({
chdir: appdir + '/'
});
Expand Down
1 change: 1 addition & 0 deletions bootstrap/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var each = require('lodash/each');
var includeAll = require('include-all');

var setAssociation = function setAssociation(modelDef, modelName) {
/* istanbul ignore else*/
if (modelDef.associate !== null && typeof modelDef.associate === 'function') {
modelDef.associate();
console.debug('associate ' + modelName);
Expand Down
12 changes: 8 additions & 4 deletions bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
var utils = require('../lib/utils');
var raven = require('raven');
global.logger = require('debug-logger');
global.appdir = utils.workspace();
/* istanbul ignore if */
if (!global.appdir) {
global.appdir = utils.workspace();
}
global.config = require('./config')();
var console = logger(config.core.log.prefix + ':app');

logger.inspectOptions = {
colors: true
};

/* istanbul ignore else*/
if (config.app && config.app.debug) {
process.env.DEBUG = config.core.log.prefix + ':*';
process.env.DEBUG = config.core.log.prefix + '*';
console.log('set env.debug to ' + config.core.log.prefix + '*');
}

global.i18n = require('i18n');
i18n.configure(config.core.langs);

// no need sentry in test
/* istanbul ignore if */
if (process.env.NODE_ENV !== "development" &&
typeof config.services !== "undefined" &&
typeof config.services.raven !== "undefined"
Expand Down
2 changes: 0 additions & 2 deletions lib/shell/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// Core
var Shell = module.exports = require('./lib/Shell');
Shell.styles = require('./lib/Styles');
Shell.NullStream = require('./lib/NullStream');

// Plugins
Shell.completer = require('./lib/plugins/completer');
Shell.error = require('./lib/plugins/error');
Shell.help = require('./lib/plugins/help');
Shell.history = require('./lib/plugins/history');
Shell.router = require('./lib/plugins/router');
Expand Down
7 changes: 3 additions & 4 deletions lib/shell/lib/Response.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'use strict';
var styles = require('./Styles');
var pad = require('pad');
var utils = require('../../utilsCmd');

var util = require('util');
var response = (function exportResponse(_super) {

var Response = function Response(settings) {
this.shell = settings.shell;
Response.__super__.constructor.call(this, settings);
Response.super_.call(this, settings);
}
utils._extends(Response, _super);
util.inherits(Response, _super);

Response.prototype.pad = pad;

Expand Down
1 change: 0 additions & 1 deletion lib/shell/lib/routes/shellOnly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
// Generated by CoffeeScript 1.4.0
/*
`routes.shellOnly`
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint global-require: 0 */
var fs = require('fs');
var path = require('path');
var existsSync = fs.existsSync || path.existsSync;
var existsSync = fs.existsSync;

module.exports = {
workspace: function workspace() {
Expand Down
17 changes: 0 additions & 17 deletions lib/utilsCmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ module.exports = {
each(result, function eachMessage(message) {
res.green(message).ln();
});

},
_extends: function extend(child, parent) {
var __hasProp = {}.hasOwnProperty;
for (var key in parent) {
if (__hasProp.call(parent, key)) {
child[key] = parent[key];
}
}

var ctor = function ctor() {
this.constructor = child;
}
ctor.prototype = parent.prototype;
child.prototype = new ctor();
child.__super__ = parent.prototype;
return child;
}
};

0 comments on commit f2e2476

Please sign in to comment.