Use local svgo.cmd wrapper binary

Switch SVG optimizer resolution from bin/svgo-cli.exe to bin/svgo.cmd.

Update unit tests to validate the new local binary path behavior.

Co-Authored-By: Abacus.AI CLI <agent@abacus.ai>
This commit is contained in:
2026-06-08 14:50:19 +02:00
parent 75059f829a
commit 6c5a5256c7
1054 changed files with 152359 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
import { optimize } from "svgo";
import fs from "fs";
const args = process.argv.slice(2);
if (args.length === 0) {
console.error("Error: No input file");
console.log("Usage: svgo <input.svg> [output.svg]");
process.exit(1);
}
const [input, output = input] = args;
if (!fs.existsSync(input)) {
console.error("Error: File not found:", input);
process.exit(2);
}
const svg = fs.readFileSync(input, "utf8");
const result = optimize(svg, { multipass: true });
fs.writeFileSync(output, result.data);
console.log("✔ Optimized:", input);