Skip to content

Commit 8848def

Browse files
committed
replace mu2 with mustache
mu2 is unmaintained and uses APIs that have been removed in node v6.
1 parent 3aca810 commit 8848def

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

lib/exporters.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
var colors = require('./colors');
22
var ppath = require('path');
3-
var mu = require('mu2');
3+
var mu = require('mustache');
44
var fs = require('fs');
55

66
var display = require('./console').Console;
77

88
// Procfile to System Service Export //
99

10-
mu.root = __dirname;
11-
1210
function render(filename, conf, callback) {
13-
var out = "";
14-
var muu = mu.compileAndRender(filename, conf);
15-
muu.on('data', function (data) {
16-
out += data;
17-
});
18-
muu.on('end', function(){
19-
callback(out);
11+
fs.readFile(filename, {encoding: 'utf8'}, function(err, template) {
12+
if (err) {
13+
throw err;
14+
}
15+
callback(mu.render(template, conf));
2016
});
2117
}
2218

lib/upstart-single/foreman-APP.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ respawn
1616
{{#envs}}env {{{key}}}="{{{value}}}"
1717
{{/envs}}
1818

19+
1920
# Not supported by older versions of Upstart, like on RHEL/CentOS
2021
chdir {{{cwd}}}
2122
setuid {{{user}}}

lib/upstart/foreman-APP-N.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ respawn
66
{{#envs}}env {{{key}}}="{{{value}}}"
77
{{/envs}}
88

9+
910
chdir {{{cwd}}}
1011
setuid {{{user}}}
1112
setgid {{{group}}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"commander": "~2.9.0",
3030
"http-proxy": "~1.11.1",
31-
"mu2": "~0.5.20",
31+
"mustache": "^2.2.1",
3232
"shell-quote": "~1.4.2"
3333
},
3434
"repository": {

test/fixtures/upstart-custom-templates/foreman-APP-N.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ respawn
66
{{#envs}}env {{{key}}}="{{{value}}}"
77
{{/envs}}
88

9+
910
chdir {{{cwd}}}
1011
setuid {{{user}}}
1112
setgid {{{group}}}

0 commit comments

Comments
 (0)