From b6e864cf0e5acc9bcd422d91b063d4ef1fbc7ebc Mon Sep 17 00:00:00 2001 From: Martin Lehmann Date: Wed, 3 Feb 2021 12:05:56 +0100 Subject: [PATCH] get unleash-server version in a less complicated way --- tools/docker-utils.js | 4 ++-- tools/unleash-server-utils.js | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 tools/unleash-server-utils.js diff --git a/tools/docker-utils.js b/tools/docker-utils.js index 1d9b7cc..38235c3 100644 --- a/tools/docker-utils.js +++ b/tools/docker-utils.js @@ -4,7 +4,6 @@ const fs = require('fs'); const path = require('path'); const tempy = require('tempy'); const execa = require('execa'); -const { getUnleashServerVersion } = require('./unleash-server-utils'); const tempDirPath = tempy.directory(); @@ -114,7 +113,8 @@ async function buildDockerImages({ nodeDockerVersions, defaultNodeDockerVersion, }) { - const unleashServerVersion = await getUnleashServerVersion(); + /** @type string */ + const unleashServerVersion = require('unleash-server/package.json').version; /** @type {{tag: string, nodeDockerVersion: string}[]} */ const artifacts = []; diff --git a/tools/unleash-server-utils.js b/tools/unleash-server-utils.js deleted file mode 100644 index 4d42a00..0000000 --- a/tools/unleash-server-utils.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -const execa = require('execa'); - -/** - * Gets the installed version of unleash-server. - * - * @returns {Promise} - */ -async function getUnleashServerVersion() { - const { stdout: npmListOutput } = await execa.command( - 'npm list unleash-server', - ); - const versionLine = npmListOutput.split('\n')[1]; - return versionLine.split('@')[1].trim(); -} - -module.exports = { getUnleashServerVersion };