mbt 1.2.6 → 1.2.7
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/README.md +1 -1
- package/bin/mbt +45 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/mbt
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var path = require("path");
|
|
3
|
+
var spawn = require("child_process").spawn;
|
|
4
|
+
var fs = require("fs");
|
|
5
|
+
|
|
6
|
+
var os = process.env.BINWRAP_PLATFORM || process.platform;
|
|
7
|
+
var arch = process.env.BINWRAP_ARCH || process.arch;
|
|
8
|
+
|
|
9
|
+
var requested = os + "-" + arch;
|
|
10
|
+
var current = process.platform + "-" + process.arch;
|
|
11
|
+
if (requested !== current ) {
|
|
12
|
+
console.error("WARNING: Using binaries for the requested platform (" + requested + ") instead of for the actual platform (" + current + ").")
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var binExt = "";
|
|
16
|
+
if (os == "win32") {
|
|
17
|
+
binExt = ".exe";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var unpackedBinPath = path.join(__dirname, "..", "unpacked_bin");
|
|
21
|
+
var binPath = path.join(unpackedBinPath, "mbt" + binExt);
|
|
22
|
+
|
|
23
|
+
function execBin() {
|
|
24
|
+
spawn(
|
|
25
|
+
binPath,
|
|
26
|
+
process.argv.slice(2),
|
|
27
|
+
{stdio: 'inherit'}
|
|
28
|
+
).on('exit', process.exit);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (fs.existsSync(binPath)) {
|
|
32
|
+
execBin();
|
|
33
|
+
} else {
|
|
34
|
+
console.error("INFO: Running " + path.basename(__filename) + " for the first time; downloading the actual binary");
|
|
35
|
+
|
|
36
|
+
var packageInfo = require(path.join(__dirname, "..", "package.json"));
|
|
37
|
+
var package = require(path.join(__dirname, "..", packageInfo.main));
|
|
38
|
+
|
|
39
|
+
package.install(unpackedBinPath, os, arch).then(function(result) {
|
|
40
|
+
execBin();
|
|
41
|
+
}, function(err) {
|
|
42
|
+
console.log("ERR", err);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
});
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mbt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "[](https://circleci.com/gh/SAP/cloud-mta-build-tool) [](https://goreportcard.com/report/github.com/SAP/cloud-mta-build-tool) [](https://coveralls.io/github/SAP/cloud-mta-build-tool?branch=cover)  ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|