ework-aio 0.3.3 → 0.3.4
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/package.json +1 -1
- package/src/commands/uninstall.ts +19 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ework-aio",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "All-in-one installer for ework (issue tracker) + ework-daemon (AI bridge) + opencode-ework (plugin). One command: npm i -g ework-aio && ework-aio install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// all user data. Idempotent — missing units or stale PID files are not
|
|
3
3
|
// errors. Data dir is never touched; user removes it manually if desired.
|
|
4
4
|
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
5
7
|
import { Logger } from "../log.ts";
|
|
6
8
|
import { resolvePaths } from "../paths.ts";
|
|
7
9
|
import { stopProcess } from "../pidfile.ts";
|
|
@@ -58,7 +60,23 @@ export async function runUninstall(opts: GlobalOptions, logger: Logger): Promise
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
// 3. Print recovery hint.
|
|
63
|
+
// Derive ework-aio's own install path from import.meta.dir so the removal
|
|
64
|
+
// command works even when npm's global prefix changed since install (the
|
|
65
|
+
// bin symlink may live under a different prefix than `npm prefix -g`).
|
|
66
|
+
const pkgRoot = path.resolve(import.meta.dir, "..", "..");
|
|
67
|
+
const binCandidates = [
|
|
68
|
+
path.join(pkgRoot, "..", "..", "..", "bin", "ework-aio"),
|
|
69
|
+
path.join(pkgRoot, "..", "..", "bin", "ework-aio"),
|
|
70
|
+
];
|
|
71
|
+
const binPath = binCandidates.find((p) => existsSync(p));
|
|
72
|
+
const rmSelf = `rm -rf ${pkgRoot}${binPath ? ` ${binPath}` : ""}`;
|
|
73
|
+
|
|
61
74
|
logger.hr();
|
|
62
75
|
logger.ok(`services removed. data preserved at ${paths.dataDir}`);
|
|
63
|
-
logger.warn(
|
|
76
|
+
logger.warn(
|
|
77
|
+
`to fully remove:\n` +
|
|
78
|
+
` rm -rf ${paths.dataDir}\n` +
|
|
79
|
+
` ${rmSelf}\n` +
|
|
80
|
+
` npm uninstall -g ework-web ework-daemon opencode-ework`,
|
|
81
|
+
);
|
|
64
82
|
}
|