@xyrlan/mnemo 0.13.1 → 0.13.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.
package/lib/bootstrap.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const { execSync, spawnSync } = require("node:child_process");
4
- const { probe } = require("./detect");
4
+ const { probeOnPath } = require("./detect");
5
5
 
6
6
 
7
7
  const PIN_SPEC = "mnemo-claude>=0.13,<0.14";
@@ -27,7 +27,7 @@ function buildUpgradeCmd(installer) {
27
27
  }
28
28
 
29
29
 
30
- function isAlreadyInstalled(probeFn = probe) {
30
+ function isAlreadyInstalled(probeFn = probeOnPath) {
31
31
  return probeFn("mnemo");
32
32
  }
33
33
 
package/lib/detect.js CHANGED
@@ -24,6 +24,17 @@ function probe(cmd) {
24
24
  }
25
25
 
26
26
 
27
+ function probeOnPath(cmd) {
28
+ const lookup = process.platform === "win32" ? `where ${cmd}` : `command -v ${cmd}`;
29
+ try {
30
+ execSync(lookup, { stdio: "ignore", shell: true });
31
+ return true;
32
+ } catch (_e) {
33
+ return false;
34
+ }
35
+ }
36
+
37
+
27
38
  function pickInstaller(probeFn = probe) {
28
39
  if (probeFn("uv")) return "uv";
29
40
  if (probeFn("pipx")) return "pipx";
@@ -64,4 +75,4 @@ function pep668InstallHint() {
64
75
  }
65
76
 
66
77
 
67
- module.exports = { parsePythonVersion, probe, pickInstaller, detectPython, isPep668, pep668InstallHint };
78
+ module.exports = { parsePythonVersion, probe, probeOnPath, pickInstaller, detectPython, isPep668, pep668InstallHint };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyrlan/mnemo",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "One-command installer for mnemo (the Obsidian that populates itself).",
5
5
  "bin": {
6
6
  "mnemo": "bin/mnemo.js"