From 584f6fd1d43d3033f2f7345209fe1565471e1cf6 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 30 Aug 2022 13:19:47 +0100 Subject: [PATCH] stack: added support for Ubuntu 22.04 refs https://github.com/TryGhost/Toolbox/issues/355 - this allows Ghost-CLI to support running on Ubuntu 22.04 by adding `22` to the allowlist regex --- lib/commands/doctor/checks/system-stack.js | 4 ++-- test/unit/commands/doctor/checks/system-stack-spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/doctor/checks/system-stack.js b/lib/commands/doctor/checks/system-stack.js index 9e9ac8957..fefbdbf01 100644 --- a/lib/commands/doctor/checks/system-stack.js +++ b/lib/commands/doctor/checks/system-stack.js @@ -5,7 +5,7 @@ const {SystemError} = require('../../../errors'); const taskTitle = 'Checking system compatibility'; const nginxProgramName = process.env.NGINX_PROGRAM_NAME || 'nginx'; -const versionRegex = /^(?:16|18|20)/; +const versionRegex = /^(?:16|18|20|22)/; async function hasService(name) { try { @@ -23,7 +23,7 @@ async function checkSystem(ctx) { const {distro, release} = await sysinfo.osInfo(); if (distro !== 'Ubuntu' || !versionRegex.test(release)) { - throw new Error('Linux version is not Ubuntu 16, 18, or 20'); + throw new Error('Linux version is not Ubuntu 16, 18, 20, or 22'); } const missing = []; diff --git a/test/unit/commands/doctor/checks/system-stack-spec.js b/test/unit/commands/doctor/checks/system-stack-spec.js index 147ae6587..bffde2ff0 100644 --- a/test/unit/commands/doctor/checks/system-stack-spec.js +++ b/test/unit/commands/doctor/checks/system-stack-spec.js @@ -88,7 +88,7 @@ describe('Unit: Doctor Checks > systemStack', function () { await systemStack.task(ctx); } catch (error) { expect(error).to.be.an.instanceof(SystemError); - expect(error.message).to.equal('System stack checks failed with message: \'Linux version is not Ubuntu 16, 18, or 20\''); + expect(error.message).to.equal('System stack checks failed with message: \'Linux version is not Ubuntu 16, 18, 20, or 22\''); expect(osInfo.calledOnce).to.be.true; expect(logStub.calledOnce).to.be.true; expect(logStub.args[0][0]).to.match(/failed with message/); @@ -114,7 +114,7 @@ describe('Unit: Doctor Checks > systemStack', function () { await systemStack.task(ctx); } catch (error) { expect(error).to.be.an.instanceof(SystemError); - expect(error.message).to.equal('System stack checks failed with message: \'Linux version is not Ubuntu 16, 18, or 20\''); + expect(error.message).to.equal('System stack checks failed with message: \'Linux version is not Ubuntu 16, 18, 20, or 22\''); expect(osInfo.calledOnce).to.be.true; expect(logStub.calledOnce).to.be.true; expect(logStub.args[0][0]).to.match(/failed with message/);