Skip to content

Commit cee0b45

Browse files
committedJun 1, 2020
Get rid of mustache too
1 parent f0042eb commit cee0b45

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed
 

‎binstub.js.mustache ‎binstub.js.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (os == "win32") {
1818
}
1919

2020
var unpackedBinPath = path.join(__dirname, "..", "unpacked_bin");
21-
var binPath = path.join(unpackedBinPath, "{{ binName }}" + binExt);
21+
var binPath = path.join(unpackedBinPath, $binName$ + binExt);
2222

2323
function execBin() {
2424
spawn(

‎package-lock.json

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"prepare.js",
2222
"test.js",
2323
"binstall.js",
24-
"binstub.js.mustache",
24+
"binstub.js.template",
2525
"bin/binwrap-install",
2626
"bin/binwrap-prepare",
2727
"bin/binwrap-test"
@@ -39,7 +39,6 @@
3939
"mocha": "^6.2.2"
4040
},
4141
"dependencies": {
42-
"mustache": "^3.1.0",
4342
"request": "^2.88.0",
4443
"tar": "^5.0.5",
4544
"unzip-stream": "^0.3.0"

‎prepare.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
var fs = require("fs");
22
var path = require("path");
3-
var mustache = require("mustache");
43

54
module.exports = function prepare(config) {
65
if (!fs.existsSync("bin")) {
76
fs.mkdirSync("bin");
87
}
98

10-
var binstubTemplate = fs.readFileSync(path.join(__dirname, "binstub.js.mustache")).toString();
9+
var binstubTemplate = fs.readFileSync(path.join(__dirname, "binstub.js.template")).toString();
1110

1211
config.binaries.forEach(function(bin) {
1312
var binPath = path.join("bin", bin);
14-
var content = mustache.render(binstubTemplate, { binName: bin });
13+
var content = binstubTemplate.replace(/\$binName\$/g, JSON.stringify(bin));
1514
fs.writeFileSync(binPath, content);
1615
fs.chmodSync(binPath, "755");
1716
});

0 commit comments

Comments
 (0)
Please sign in to comment.