@tiledesk/tiledesk-server 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/deploy.sh CHANGED
@@ -1,5 +1,5 @@
1
1
  git pull
2
- npm version minor
2
+ npm version patch
3
3
  version=`node -e 'console.log(require("./package.json").version)'`
4
4
  echo "version $version"
5
5
 
@@ -4,20 +4,30 @@ var path = require('path');
4
4
  var winston = require('../config/winston');
5
5
 
6
6
 
7
- var labelsDir = __dirname+"/../config/labels/";
7
+ var labelsDir = __dirname + "/../config/labels/";
8
8
  winston.debug('labelsDir: ' + labelsDir);
9
9
 
10
10
 
11
- module.exports = function(req, res, next) {
12
- var filePath = path.join(labelsDir, 'widget.json');
13
-
14
- fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
15
- if (err) {
16
- winston.error('Error getting labels', err);
17
- return res.status(500).send({ success: false, msg: 'Error reading object.' });
18
- }
19
- winston.debug('label fetched', data);
20
- req.labels = JSON.parse(data);
21
- next();
22
- });
11
+ module.exports = function (req, res, next) {
12
+ var filePath = path.join(labelsDir, 'widget.json');
13
+
14
+ fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
15
+ if (err) {
16
+ winston.error('Error getting labels', err);
17
+ return res.status(500).send({ success: false, msg: 'Error reading object.' });
18
+ }
19
+ winston.debug('label fetched', data);
20
+
21
+ // Replace {{ BRAND_NAME }} with process.env.BRAND_NAME value (default value "Tiledesk")
22
+ let brand_name = process.env.BRAND_NAME;
23
+
24
+ if (brand_name) {
25
+ data = data.replaceAll("Tiledesk", brand_name);
26
+ data = data.replaceAll("tiledesk", brand_name.toLowerCase());
27
+
28
+ }
29
+
30
+ req.labels = JSON.parse(data);
31
+ next();
32
+ });
23
33
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.7.0",
4
+ "version": "2.7.1",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",