windsor-bot 0.1.14 → 0.1.15
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/server.js +7 -2
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -65,8 +65,13 @@ async function readPackageVersion() {
|
|
|
65
65
|
return packageJson.version;
|
|
66
66
|
}
|
|
67
67
|
async function updateGlobalBot() {
|
|
68
|
-
|
|
69
|
-
const
|
|
68
|
+
// GUI-launched processes may not inherit the shell PATH where npm is installed.
|
|
69
|
+
const npmEnv = {
|
|
70
|
+
...process.env,
|
|
71
|
+
PATH: [dirname(process.execPath), process.env.PATH].filter(Boolean).join(process.platform === 'win32' ? ';' : ':'),
|
|
72
|
+
};
|
|
73
|
+
await execFileAsync('npm', ['install', '-g', 'windsor-bot@latest'], { env: npmEnv });
|
|
74
|
+
const { stdout } = await execFileAsync('npm', ['root', '-g'], { env: npmEnv });
|
|
70
75
|
const packageJsonPath = join(stdout.trim(), 'windsor-bot', 'package.json');
|
|
71
76
|
const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8'));
|
|
72
77
|
if (typeof packageJson.version !== 'string')
|