@locusai/locus-pm2 0.22.14 → 0.23.0
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.cjs +17 -0
- package/dist/index.js +17 -0
- package/dist/pm2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -51,9 +51,26 @@ module.exports = __toCommonJS(exports_src);
|
|
|
51
51
|
|
|
52
52
|
// src/pm2.ts
|
|
53
53
|
var import_node_child_process = require("node:child_process");
|
|
54
|
+
var import_node_fs = require("node:fs");
|
|
54
55
|
var import_node_path = require("node:path");
|
|
55
56
|
var import_node_url = require("node:url");
|
|
56
57
|
function getPm2Bin() {
|
|
58
|
+
let dir = process.cwd();
|
|
59
|
+
while (dir !== import_node_path.dirname(dir)) {
|
|
60
|
+
const candidate = import_node_path.join(dir, "node_modules", ".bin", "pm2");
|
|
61
|
+
if (import_node_fs.existsSync(candidate))
|
|
62
|
+
return candidate;
|
|
63
|
+
dir = import_node_path.dirname(dir);
|
|
64
|
+
}
|
|
65
|
+
if (process.argv[1]) {
|
|
66
|
+
let scriptDir = import_node_path.dirname(process.argv[1]);
|
|
67
|
+
while (scriptDir !== import_node_path.dirname(scriptDir)) {
|
|
68
|
+
const candidate = import_node_path.join(scriptDir, "node_modules", ".bin", "pm2");
|
|
69
|
+
if (import_node_fs.existsSync(candidate))
|
|
70
|
+
return candidate;
|
|
71
|
+
scriptDir = import_node_path.dirname(scriptDir);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
57
74
|
try {
|
|
58
75
|
const result = import_node_child_process.execSync("which pm2", {
|
|
59
76
|
encoding: "utf-8",
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
// src/pm2.ts
|
|
2
2
|
import { execSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
3
4
|
import { dirname, join } from "node:path";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
function getPm2Bin() {
|
|
7
|
+
let dir = process.cwd();
|
|
8
|
+
while (dir !== dirname(dir)) {
|
|
9
|
+
const candidate = join(dir, "node_modules", ".bin", "pm2");
|
|
10
|
+
if (existsSync(candidate))
|
|
11
|
+
return candidate;
|
|
12
|
+
dir = dirname(dir);
|
|
13
|
+
}
|
|
14
|
+
if (process.argv[1]) {
|
|
15
|
+
let scriptDir = dirname(process.argv[1]);
|
|
16
|
+
while (scriptDir !== dirname(scriptDir)) {
|
|
17
|
+
const candidate = join(scriptDir, "node_modules", ".bin", "pm2");
|
|
18
|
+
if (existsSync(candidate))
|
|
19
|
+
return candidate;
|
|
20
|
+
scriptDir = dirname(scriptDir);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
6
23
|
try {
|
|
7
24
|
const result = execSync("which pm2", {
|
|
8
25
|
encoding: "utf-8",
|
package/dist/pm2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pm2.d.ts","sourceRoot":"","sources":["../src/pm2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"pm2.d.ts","sourceRoot":"","sources":["../src/pm2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAsDD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CA4BlD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAGjD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAGpD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAGnD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CA4B7D;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,SAAK,GAAG,MAAM,CAM7D;AAID;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,GACd,MAAM,CAIR"}
|