From df4cf80be4d8b18b6d7ed77a42dc8c966827a061 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 21 Nov 2021 17:20:28 +0100 Subject: [PATCH] fix version detection without running npm --- src/routes/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/index.js b/src/routes/index.js index 37ba9fb46..6a1abe66a 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -9,6 +9,7 @@ const log = require('../services/log'); const env = require('../services/env'); const utils = require('../services/utils'); const protectedSessionService = require("../services/protected_session"); +const packageJson = require('../../package.json'); function index(req, res) { const options = optionService.getOptionsMap(); @@ -37,7 +38,7 @@ function index(req, res) { extraHoistedNoteId: req.query.extraHoistedNoteId, isProtectedSessionAvailable: protectedSessionService.isProtectedSessionAvailable(), maxContentWidth: parseInt(options.maxContentWidth), - triliumVersion: process.env.npm_package_version + triliumVersion: packageJson.version }); }