Skip to content

Commit

Permalink
stack: added support for Ubuntu 22.04
Browse files Browse the repository at this point in the history
refs TryGhost/Toolbox#355

- this allows Ghost-CLI to support running on Ubuntu 22.04 by adding
  `22` to the allowlist regex
  • Loading branch information
daniellockyer committed Aug 30, 2022
1 parent 247062f commit 584f6fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/commands/doctor/checks/system-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 = [];
Expand Down
4 changes: 2 additions & 2 deletions test/unit/commands/doctor/checks/system-stack-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
Expand All @@ -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/);
Expand Down

0 comments on commit 584f6fd

Please sign in to comment.