Skip to content

Commit eecb47a

Browse files
authored
Merge pull request #165 from OS2Forms/f/os2forms_version
OS-175 package version on status page
2 parents e169d24 + 0734a2c commit eecb47a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
- Updating the display of os2forms package on the status page
15+
1416
## [4.0.0] 2025-03-06
1517

1618
- This is an alias for for 3.22.2. Major change is the module removal, which can lead to lack of backward support.

os2forms.install

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Install file for OS2Forms module.
66
*/
77

8+
use Composer\InstalledVersions;
89
use Drupal\field\Entity\FieldConfig;
910
use Drupal\field\Entity\FieldStorageConfig;
1011
use Drupal\taxonomy\Entity\Term;
@@ -63,21 +64,17 @@ function os2forms_requirements($phase) {
6364
'value' => $messages,
6465
];
6566

66-
$commit_sha = exec('git rev-parse HEAD');
67-
$tag = exec("git describe --tags --abbrev=0");
68-
$remote = exec('git config --get remote.origin.url');
67+
$reference = InstalledVersions::getReference("os2forms/os2forms");
68+
$version = InstalledVersions::getPrettyVersion("os2forms/os2forms");
6969

7070
$version_messages = [
7171
'#prefix' => t('OS2Forms version'),
7272
'#theme' => 'item_list',
7373
'#items' => [
74-
0 => t('tag <strong>@tag</strong> (commit: <strong>@commit</strong>)', [
75-
'@tag' => $tag,
76-
'@commit' => $commit_sha,
77-
]),
78-
1 => t('remote: <strong>@remote</strong>', [
79-
'@remote' => $remote,
80-
]),
74+
0 => t('version <strong>@version</strong> (commit: <strong>@reference</strong>)', [
75+
'@version' => $version,
76+
'@reference' => $reference,
77+
])
8178
],
8279
];
8380

0 commit comments

Comments
 (0)