@omicverse/omicos 0.2.30 → 0.2.31

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/bin/postinstall.js +86 -0
  2. package/package.json +10 -7
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const fs = require("node:fs");
5
+ const os = require("node:os");
6
+ const path = require("node:path");
7
+
8
+ function isGlobalInstall() {
9
+ return process.env.npm_config_global === "true";
10
+ }
11
+
12
+ function canExecute(file) {
13
+ try {
14
+ const stat = fs.statSync(file);
15
+ if (!stat.isFile() && !stat.isSymbolicLink()) return false;
16
+ fs.accessSync(file, fs.constants.X_OK);
17
+ return true;
18
+ } catch (_e) {
19
+ return false;
20
+ }
21
+ }
22
+
23
+ function realpathOrSelf(file) {
24
+ try {
25
+ return fs.realpathSync(file);
26
+ } catch (_e) {
27
+ return file;
28
+ }
29
+ }
30
+
31
+ function pathEntries() {
32
+ return (process.env.PATH || "")
33
+ .split(path.delimiter)
34
+ .filter(Boolean);
35
+ }
36
+
37
+ function findOmicosOnPath() {
38
+ const seen = new Set();
39
+ const matches = [];
40
+ for (const dir of pathEntries()) {
41
+ const candidate = path.join(dir, "omicos");
42
+ if (!canExecute(candidate)) continue;
43
+ const resolved = realpathOrSelf(candidate);
44
+ if (seen.has(resolved)) continue;
45
+ seen.add(resolved);
46
+ matches.push({ path: candidate, resolved });
47
+ }
48
+ return matches;
49
+ }
50
+
51
+ function shellQuote(value) {
52
+ return `'${String(value).replace(/'/g, "'\\''")}'`;
53
+ }
54
+
55
+ function main() {
56
+ if (process.platform === "win32" || !isGlobalInstall()) return;
57
+
58
+ const ownWrapper = realpathOrSelf(path.join(__dirname, "omicos.js"));
59
+ const matches = findOmicosOnPath();
60
+ const first = matches[0];
61
+ if (!first || first.resolved === ownWrapper) return;
62
+
63
+ const npmBin = process.env.npm_config_prefix
64
+ ? path.join(process.env.npm_config_prefix, "bin")
65
+ : "$(npm prefix -g)/bin";
66
+ const legacyPath = path.join(os.homedir(), ".local", "bin", "omicos");
67
+
68
+ console.warn("");
69
+ console.warn("OmicOS notice: npm installed @omicverse/omicos, but your shell currently resolves a different `omicos` first.");
70
+ console.warn(` current first: ${first.path}`);
71
+ console.warn(` npm bin: ${npmBin}`);
72
+ console.warn("");
73
+ console.warn("To use the npm-installed OmicOS in this shell:");
74
+ console.warn(` export PATH=${shellQuote(npmBin)}:"$PATH"`);
75
+ console.warn(" hash -r 2>/dev/null || rehash");
76
+ console.warn(" omicos -V");
77
+ console.warn("");
78
+ console.warn("If the first path is the older official Linux installer binary, back it up with:");
79
+ console.warn(` mv ${shellQuote(legacyPath)} ${shellQuote(`${legacyPath}.old`)}`);
80
+ console.warn("");
81
+ console.warn("Debug command:");
82
+ console.warn(" type -a omicos");
83
+ console.warn("");
84
+ }
85
+
86
+ main();
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@omicverse/omicos",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "description": "OmicOS \u2014 agentic omics-analysis runtime & CLI (omicos-core). Installs the matching native binary for your platform.",
5
5
  "bin": {
6
6
  "omicos": "bin/omicos.js"
7
7
  },
8
+ "scripts": {
9
+ "postinstall": "node bin/postinstall.js"
10
+ },
8
11
  "files": [
9
12
  "bin"
10
13
  ],
@@ -16,12 +19,12 @@
16
19
  "url": "git+https://github.com/PrimorDecode/omicos-core.git"
17
20
  },
18
21
  "optionalDependencies": {
19
- "@omicverse/omicos-linux-x64": "0.2.30",
20
- "@omicverse/omicos-linux-arm64": "0.2.30",
21
- "@omicverse/omicos-darwin-x64": "0.2.30",
22
- "@omicverse/omicos-darwin-arm64": "0.2.30",
23
- "@omicverse/omicos-win32-x64": "0.2.30",
24
- "@omicverse/omicos-win32-arm64": "0.2.30"
22
+ "@omicverse/omicos-linux-x64": "0.2.31",
23
+ "@omicverse/omicos-linux-arm64": "0.2.31",
24
+ "@omicverse/omicos-darwin-x64": "0.2.31",
25
+ "@omicverse/omicos-darwin-arm64": "0.2.31",
26
+ "@omicverse/omicos-win32-x64": "0.2.31",
27
+ "@omicverse/omicos-win32-arm64": "0.2.31"
25
28
  },
26
29
  "publishConfig": {
27
30
  "access": "public"