recappi 0.1.33 → 0.1.34

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/dist/index.js CHANGED
@@ -20102,6 +20102,7 @@ import {
20102
20102
  statSync,
20103
20103
  writeFileSync
20104
20104
  } from "fs";
20105
+ import { createHash } from "crypto";
20105
20106
  import { createRequire as createRequire2 } from "module";
20106
20107
  import { homedir } from "os";
20107
20108
  import { dirname, join as join2 } from "path";
@@ -20767,16 +20768,21 @@ function stableDarwinHelperAppPath(opts = {}) {
20767
20768
  return join2(base, SIDECAR_APP_BUNDLE_NAME);
20768
20769
  }
20769
20770
  function helperSourceSignature(sourceApp) {
20770
- const executable = statSync(darwinAppExecutablePath(sourceApp));
20771
- const info = statSync(join2(sourceApp, "Contents", "Info.plist"));
20771
+ const executablePath = darwinAppExecutablePath(sourceApp);
20772
+ const infoPath = join2(sourceApp, "Contents", "Info.plist");
20773
+ const signaturePath = join2(sourceApp, "Contents", "_CodeSignature", "CodeResources");
20772
20774
  return JSON.stringify({
20773
20775
  app: SIDECAR_APP_BUNDLE_NAME,
20774
- executableSize: executable.size,
20775
- executableMtimeMs: executable.mtimeMs,
20776
- infoSize: info.size,
20777
- infoMtimeMs: info.mtimeMs
20776
+ executable: fileDigest(executablePath),
20777
+ info: fileDigest(infoPath),
20778
+ codeSignature: existsSync(signaturePath) ? fileDigest(signaturePath) : null
20778
20779
  });
20779
20780
  }
20781
+ function fileDigest(path6) {
20782
+ const hash2 = createHash("sha256");
20783
+ hash2.update(readFileSync2(path6));
20784
+ return hash2.digest("hex");
20785
+ }
20780
20786
  function readTextIfExists(path6) {
20781
20787
  try {
20782
20788
  return readFileSync2(path6, "utf8");