foxguard 0.7.1 → 0.8.1

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 CHANGED
@@ -45,6 +45,6 @@ foxguard is built around fast local feedback.
45
45
 
46
46
  ## More
47
47
 
48
- - [GitHub](https://github.com/PwnKit-Labs/foxguard)
48
+ - [GitHub](https://github.com/0sec-labs/foxguard)
49
49
  - [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=peaktwilight.foxguard)
50
50
  - [foxguard.dev](https://foxguard.dev)
package/bin/foxguard CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { execFileSync, execSync } = require("child_process");
3
+ const { execFileSync } = require("child_process");
4
4
  const fs = require("fs");
5
5
  const path = require("path");
6
6
  const os = require("os");
7
7
  const https = require("https");
8
8
 
9
9
  const VERSION = require("../package.json").version;
10
- const REPO = "PwnKit-Labs/foxguard";
10
+ const REPO = "0sec-labs/foxguard";
11
11
 
12
12
  // Platform mapping: [node os, node arch] -> GitHub release asset suffix
13
13
  const PLATFORM_MAP = {
@@ -48,35 +48,6 @@ function getBinaryName() {
48
48
  return os.platform() === "win32" ? "foxguard.exe" : "foxguard";
49
49
  }
50
50
 
51
- // Check if cargo-installed foxguard exists
52
- function findCargoInstall() {
53
- try {
54
- const cargoHome = process.env.CARGO_HOME || path.join(os.homedir(), ".cargo");
55
- const cargoBin = path.join(cargoHome, "bin", getBinaryName());
56
- if (fs.existsSync(cargoBin)) {
57
- return cargoBin;
58
- }
59
- } catch {}
60
-
61
- // Try PATH
62
- try {
63
- const which = os.platform() === "win32" ? "where" : "which";
64
- const result = execSync(`${which} foxguard 2>/dev/null`, {
65
- encoding: "utf8",
66
- }).trim();
67
- if (result && !result.includes("node_modules")) {
68
- // Resolve symlinks to avoid finding ourselves (the npm wrapper)
69
- const resolved = fs.realpathSync(result);
70
- const thisScript = fs.realpathSync(__filename);
71
- if (resolved !== thisScript) {
72
- return result;
73
- }
74
- }
75
- } catch {}
76
-
77
- return null;
78
- }
79
-
80
51
  function download(url) {
81
52
  return new Promise((resolve, reject) => {
82
53
  const get = (u) => {
@@ -151,18 +122,11 @@ async function downloadBinary() {
151
122
  }
152
123
 
153
124
  async function main() {
154
- // 1. Check for cargo-installed binary
155
- const cargoBin = findCargoInstall();
156
- if (cargoBin) {
157
- try {
158
- execFileSync(cargoBin, process.argv.slice(2), { stdio: "inherit" });
159
- return;
160
- } catch (e) {
161
- process.exit(e.status || 1);
162
- }
163
- }
164
-
165
- // 2. Download or use cached binary
125
+ // Always resolve to the binary matching the npm package version. A
126
+ // previously-installed foxguard on PATH (cargo, Homebrew, etc.) may be
127
+ // an older version that does not understand newer subcommands, so we
128
+ // ignore it. Users who want their own foxguard can invoke it directly
129
+ // instead of via `npx`.
166
130
  const bin = await downloadBinary();
167
131
  try {
168
132
  execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "foxguard",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "A security scanner as fast as a linter, written in Rust. 170+ built-in rules across 10 languages.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/PwnKit-Labs/foxguard.git"
8
+ "url": "https://github.com/0sec-labs/foxguard.git"
9
9
  },
10
10
  "homepage": "https://foxguard.dev",
11
11
  "keywords": [