UNPKG

1.11 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.execWine = execWine;
7exports.prepareWindowsExecutableArgs = prepareWindowsExecutableArgs;
8
9function _builderUtil() {
10 const data = require("builder-util");
11
12 _builderUtil = function () {
13 return data;
14 };
15
16 return data;
17}
18
19/** @private */
20function execWine(file, file64 = null, appArgs = [], options = {}) {
21 if (process.platform === "win32") {
22 if (options.timeout == null) {
23 // 2 minutes
24 options.timeout = 120 * 1000;
25 }
26
27 return (0, _builderUtil().exec)(file, appArgs, options);
28 }
29
30 const commandArgs = ["wine", "--ia32", file];
31
32 if (file64 != null) {
33 commandArgs.push("--x64", file64);
34 }
35
36 if (appArgs.length > 0) {
37 commandArgs.push("--args", JSON.stringify(appArgs));
38 }
39
40 return (0, _builderUtil().executeAppBuilder)(commandArgs, undefined, options);
41}
42/** @private */
43
44
45function prepareWindowsExecutableArgs(args, exePath) {
46 if (process.platform !== "win32") {
47 args.unshift(exePath);
48 }
49
50 return args;
51}
52// __ts-babel@6.0.4
53//# sourceMappingURL=wine.js.map
\No newline at end of file