@wrongstack/tools 0.8.2 → 0.8.5

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.
@@ -5,7 +5,7 @@ import { createRequire } from 'node:module';
5
5
  import * as fs from 'node:fs';
6
6
  import { mkdirSync, writeFileSync } from 'node:fs';
7
7
  import * as ts from 'typescript';
8
- import { execSync, spawnSync } from 'node:child_process';
8
+ import { execFileSync, spawnSync } from 'node:child_process';
9
9
  import * as os from 'node:os';
10
10
 
11
11
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -847,7 +847,7 @@ function syncGoParse(filePath, content, lang) {
847
847
  mkdirSync(tmpDir, { recursive: true });
848
848
  const scriptPath = path4.join(tmpDir, "parse.go");
849
849
  writeFileSync(scriptPath, GO_PARSE_SCRIPT, "utf8");
850
- const stdout = execSync(`go run "${scriptPath}"`, {
850
+ const stdout = execFileSync("go", ["run", scriptPath], {
851
851
  input: content,
852
852
  timeout: 15e3,
853
853
  encoding: "utf8",
@@ -1093,7 +1093,7 @@ function syncPyParse(filePath, lang) {
1093
1093
  mkdirSync(tmpDir, { recursive: true });
1094
1094
  const scriptPath = path4.join(tmpDir, "parse.py");
1095
1095
  writeFileSync(scriptPath, PY_PARSE_SCRIPT, "utf8");
1096
- const stdout = execSync(`python "${scriptPath}" "${filePath}"`, {
1096
+ const stdout = execFileSync("python", [scriptPath, filePath], {
1097
1097
  timeout: 15e3,
1098
1098
  encoding: "utf8",
1099
1099
  windowsHide: true
@@ -1131,11 +1131,19 @@ function parseSymbols4(opts) {
1131
1131
  }
1132
1132
  function checkNativeParser() {
1133
1133
  try {
1134
- execSync("rustc --version", { stdio: "pipe" });
1134
+ execFileSync("rustc", ["--version"], { stdio: "pipe" });
1135
1135
  const toolsDir = path4.join(process.cwd(), "tools");
1136
1136
  try {
1137
- execSync(
1138
- "cargo metadata --no-deps --format-version 1 --manifest-path " + path4.join(toolsDir, "Cargo.toml"),
1137
+ execFileSync(
1138
+ "cargo",
1139
+ [
1140
+ "metadata",
1141
+ "--no-deps",
1142
+ "--format-version",
1143
+ "1",
1144
+ "--manifest-path",
1145
+ path4.join(toolsDir, "Cargo.toml")
1146
+ ],
1139
1147
  { stdio: "pipe" }
1140
1148
  );
1141
1149
  return true;