sygal-cli 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2397,6 +2397,17 @@ var import_node_fs6 = require("node:fs");
2397
2397
  var import_node_module = require("node:module");
2398
2398
  var import_node_path8 = require("node:path");
2399
2399
  var requireFromHere = (0, import_node_module.createRequire)(__filename);
2400
+ function ensureExecutable(path) {
2401
+ if (process.platform === "win32") return;
2402
+ try {
2403
+ (0, import_node_fs6.accessSync)(path, import_node_fs6.constants.X_OK);
2404
+ } catch {
2405
+ try {
2406
+ (0, import_node_fs6.chmodSync)(path, 493);
2407
+ } catch {
2408
+ }
2409
+ }
2410
+ }
2400
2411
  function resolveSidecarCommand() {
2401
2412
  const envPath = process.env.SYGAL_SIDECAR_PATH;
2402
2413
  if (envPath) {
@@ -2408,7 +2419,10 @@ function resolveSidecarCommand() {
2408
2419
  try {
2409
2420
  const pkgJsonPath = requireFromHere.resolve(`${pkgName}/package.json`);
2410
2421
  const bin = (0, import_node_path8.join)((0, import_node_path8.dirname)(pkgJsonPath), "bin", binaryName);
2411
- if ((0, import_node_fs6.existsSync)(bin)) return { command: bin, args: [] };
2422
+ if ((0, import_node_fs6.existsSync)(bin)) {
2423
+ ensureExecutable(bin);
2424
+ return { command: bin, args: [] };
2425
+ }
2412
2426
  } catch {
2413
2427
  }
2414
2428
  let dir = __dirname;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sygal-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Sygal CLI - convert files and web pages to Markdown/JSON (local MarkItDown pipeline, OCR for images)",
5
5
  "author": "Cyrill Semah",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -36,8 +36,8 @@
36
36
  "@sygal/core": "0.1.0"
37
37
  },
38
38
  "optionalDependencies": {
39
- "@sygal/sidecar-darwin-arm64": "0.1.0",
40
- "@sygal/sidecar-win32-x64": "0.1.0"
39
+ "@sygal/sidecar-darwin-arm64": "0.1.2",
40
+ "@sygal/sidecar-win32-x64": "0.1.2"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=cjs --outfile=dist/index.js --external:sharp --external:gpt-tokenizer --external:commander --external:picocolors",