Browse Source

modify the way to import growi bot version string

yuto-o 4 years ago
parent
commit
53b5374038
2 changed files with 2 additions and 2 deletions
  1. 0 1
      packages/slackbot-proxy/.env
  2. 2 1
      packages/slackbot-proxy/src/controllers/top.ts

+ 0 - 1
packages/slackbot-proxy/.env

@@ -1,3 +1,2 @@
 SLACK_INSTALLPROVIDER_STATE_SECRET=change-it
 OFFICIAL_MODE=false
-GROWI_BOT_VERSION=3.0.1

+ 2 - 1
packages/slackbot-proxy/src/controllers/top.ts

@@ -3,6 +3,7 @@ import {
 } from '@tsed/common';
 
 import { requiredScopes } from '@growi/slack';
+import pkg from '~/../package.json';
 import { InstallerService } from '~/services/InstallerService';
 
 const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
@@ -22,7 +23,7 @@ export class TopCtrl {
       scopes: requiredScopes,
     });
 
-    const growiBotVersion = process.env.GROWI_BOT_VERSION;
+    const growiBotVersion = pkg.version;
 
     return { url, isOfficialMode, growiBotVersion };
   }