@inetafrica/open-claudia 1.2.7 → 1.2.8
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/bot.js +3 -2
- package/package.json +1 -1
package/bot.js
CHANGED
|
@@ -809,14 +809,15 @@ bot.onText(/\/upgrade$/, async (msg) => {
|
|
|
809
809
|
try {
|
|
810
810
|
execSync("npm install -g @inetafrica/open-claudia@latest 2>&1", {
|
|
811
811
|
encoding: "utf-8", timeout: 120000,
|
|
812
|
-
env: { ...process.env, PATH: FULL_PATH },
|
|
812
|
+
env: { ...process.env, PATH: FULL_PATH, HOME: process.env.HOME || require("os").homedir() },
|
|
813
813
|
});
|
|
814
814
|
// Read version from newly installed package
|
|
815
815
|
const root = execSync("npm root -g", { encoding: "utf-8", env: { ...process.env, PATH: FULL_PATH } }).trim();
|
|
816
816
|
const newPkg = JSON.parse(fs.readFileSync(path.join(root, "@inetafrica", "open-claudia", "package.json"), "utf-8"));
|
|
817
817
|
await send(`Installed v${newPkg.version}. Going offline to restart...`);
|
|
818
818
|
} catch (e) {
|
|
819
|
-
|
|
819
|
+
const errOutput = (e.stdout || e.stderr || e.message || "").slice(-500);
|
|
820
|
+
await send(`Upgrade failed:\n${errOutput}`);
|
|
820
821
|
return;
|
|
821
822
|
}
|
|
822
823
|
// Give Telegram time to deliver the message, then exit for launchd to restart
|