@brunoluizdesiqueira/bbuilder-cli 1.0.5 → 1.0.6

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.
@@ -40,6 +40,7 @@ exports.buildCompilerFlags = buildCompilerFlags;
40
40
  exports.runCgrc = runCgrc;
41
41
  exports.runDcc64 = runDcc64;
42
42
  exports.runBuiltExecutable = runBuiltExecutable;
43
+ const child_process_1 = require("child_process");
43
44
  const execa_1 = __importDefault(require("execa"));
44
45
  const fs = __importStar(require("fs"));
45
46
  const os = __importStar(require("os"));
@@ -78,13 +79,24 @@ function buildDependencies(opts) {
78
79
  function quoteForCmd(value) {
79
80
  if (!value)
80
81
  return '""';
81
- return `"${value.replace(/"/g, '""')}"`;
82
+ return `"${value.replace(/"/g, '\\"')}"`;
82
83
  }
83
84
  async function runWindowsCommand(executable, args, cwd) {
84
85
  const command = [quoteForCmd(executable), ...args.map(quoteForCmd)].join(' ');
85
- await (0, execa_1.default)('cmd.exe', ['/d', '/s', '/c', command], {
86
- cwd,
87
- stdio: 'inherit',
86
+ await new Promise((resolve, reject) => {
87
+ const child = (0, child_process_1.spawn)(command, {
88
+ cwd,
89
+ stdio: 'inherit',
90
+ shell: true,
91
+ });
92
+ child.on('error', reject);
93
+ child.on('exit', code => {
94
+ if (code === 0) {
95
+ resolve();
96
+ return;
97
+ }
98
+ reject(new Error(`Command exited with code ${code ?? 'unknown'}`));
99
+ });
88
100
  });
89
101
  }
90
102
  async function runCgrc(opts, projectName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunoluizdesiqueira/bbuilder-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "CLI de build local para projetos Delphi do Bimer",
5
5
  "license": "ISC",
6
6
  "repository": {