mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Allowed version build info to be shown in Admin
refs https://ghost.slack.com/archives/C02G9E68C/p1679577089441659 - this allows the full Ghost version through the API so we can extract the build info from it and provide a link to GitHub
This commit is contained in:
parent
3432857f9a
commit
db998e20ec
@ -1,6 +1,6 @@
|
||||
import Component from '@glimmer/component';
|
||||
import config from 'ghost-admin/config/environment';
|
||||
import semver from 'semver';
|
||||
import semverParse from 'semver/functions/parse';
|
||||
import {inject} from 'ghost-admin/decorators/inject';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
@ -24,15 +24,10 @@ export default class AboutModal extends Component {
|
||||
get linkToGitHubReleases() {
|
||||
if (this.config.version.includes('-pre.')) {
|
||||
try {
|
||||
const semverVersion = semver.parse(this.config.version, {includePrerelease: true});
|
||||
const semverVersion = semverParse(this.config.version, {includePrerelease: true});
|
||||
|
||||
// Ensure this follows our prerelease format
|
||||
if (semverVersion
|
||||
&& semverVersion.prerelease?.[0] === 'pre'
|
||||
&& semverVersion.prerelease?.[1]
|
||||
&& Number.isInteger(semverVersion.prerelease?.[2])
|
||||
) {
|
||||
return `https://github.com/TryGhost/Ghost/commit/${semverVersion.prerelease[1]}`;
|
||||
if (semverVersion && semverVersion.build?.[0]) {
|
||||
return `https://github.com/TryGhost/Ghost/commit/${semverVersion.build[0]}`;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -6,7 +6,7 @@ const ghostVersion = require('@tryghost/version');
|
||||
|
||||
module.exports = function getConfigProperties() {
|
||||
const configProperties = {
|
||||
version: ghostVersion.full,
|
||||
version: ghostVersion.original,
|
||||
environment: config.get('env'),
|
||||
database: databaseInfo.getEngine(),
|
||||
mail: isPlainObject(config.get('mail')) ? config.get('mail').transport : '',
|
||||
|
Loading…
Reference in New Issue
Block a user