Skip to content

Commit

Permalink
Merge pull request #159 from MCS-Lite/adjust-for-7688
Browse files Browse the repository at this point in the history
adjust for build 7688
  • Loading branch information
iamblue authored Jun 27, 2017
2 parents 6d4496e + 177049d commit 366f8d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ script:

# Build App (NW.js)
- npm run build:global
- npm run build:7688

# Compression
- cd ./out/mcs-lite-app
Expand All @@ -37,7 +38,7 @@ deploy:
api_key:
secure: Ii5Phu/1jnnXjtNbwt+FSH2CBq7Db7TXKoHoN7SrPJAs7w+J/ZDSTKf0Scbck+8woyImXTlh6pX+3qXU57u3FkigeOqX46i4OcT7SJQ+lVbgIVJRNojlw0gZmZ1hgTLWl5914xMnO82+99xjlU2amG4Cv7jkx61M8Os56pqR4kMo6uy1YkSEYNc06cZYNTkNWuGfxlCyMtz3G4WYgKEJXEqbfGJ7Hz6jWkaG+g03KuzBI1XbjNpT13VyxSkcC+xz4uaPO6ZRR5f6wKUbyGfl51xYmZkwYdqc2Zm2tfG+S1gHpyQwz9fXb5DOR5FbRWOmW+YSvbBZwELA67nxpempMT1Nx0v0sp6z8pOeJQLZKuyhMe2kRZD6nKY/feMSVC0ABnbqw4MiitgLcHMqVLpir45JuhoWqkEGU24zbu6Ut37UcrXgdcD7lXzTy2tEHptgsiRk0Y5oMMjZhRLiausD4g2cg7m4cfC4tuScEWwEXqTTScPZTrF5t0XhfOJoVwaz6x//kmx9drYbBTaWJSul4WMiVcxm9OmSxez7BKQx9Wa4i+IecbG5feFS6lKqtwL7hSbEoM9SYtof/F4QfJedE3pl43GwVNNpf+618HvNZMmwxtAXIiXzc7AAobXyT2JPOwKme9tx5ziUch7TSqZi3hnL/19cbndeb0GvuXcDHcc=
file_glob: true
file: './out/mcs-lite-app/*.{tar.gz,zip}'
file: './out/mcs-lite-app/*.{tar.gz,zip,tar}'
skip_cleanup: true
on:
repo: MCS-Lite/mcs-lite-app
Expand Down
2 changes: 1 addition & 1 deletion restserver/controllers/fota.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function ($db) {
console.log(data.toString());
});

mkdir.on('exit', (code) => {
mkdir.on('exit', function(code) {
return resolve();
});
})
Expand Down
13 changes: 5 additions & 8 deletions restserver/controllers/generator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fileExists = require('file-exists');
var path = require('path');
var fs = require('fs');

module.exports = function ($db) {
var arduinoGenerator = function(req, res, next) {
Expand All @@ -18,11 +18,7 @@ module.exports = function ($db) {
const templatePath = datachannelTypeId + '/' + typeId + '/' + method + '/';
const filePath = path.resolve(__dirname, '../../client/apiHints/' + templatePath, content + '.ejs');

if (!fileExists(filePath)) {
// if (!fileExists.sync(filePath)) {
return res.send(400, { message: 'Cannot find this file.'});
}


var apiHost = global.host.split(':')[0];
var apiPort = global.host.split(':')[1].split('/')[0];

Expand All @@ -33,12 +29,13 @@ module.exports = function ($db) {
host: apiHost,
port: apiPort
};

// Remind: Send the text as json format to keep whitespace / break-line / tab.
return res.render(filePath, configs, (err, html) => {
return res.render(filePath, configs, function(err, html) {
if (err) console.log(err);
return res.send(JSON.stringify(html));
});

};

return {
Expand Down

0 comments on commit 366f8d7

Please sign in to comment.