Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OS-175 package version on status page #165

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- Updating the display of os2forms package on the status page

## [4.0.0] 2025-03-06

- This is an alias for for 3.22.2. Major change is the module removal, which can lead to lack of backward support.
Expand Down
17 changes: 7 additions & 10 deletions os2forms.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Install file for OS2Forms module.
*/

use Composer\InstalledVersions;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\taxonomy\Entity\Term;
Expand Down Expand Up @@ -63,21 +64,17 @@ function os2forms_requirements($phase) {
'value' => $messages,
];

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

$version_messages = [
'#prefix' => t('OS2Forms version'),
'#theme' => 'item_list',
'#items' => [
0 => t('tag <strong>@tag</strong> (commit: <strong>@commit</strong>)', [
'@tag' => $tag,
'@commit' => $commit_sha,
]),
1 => t('remote: <strong>@remote</strong>', [
'@remote' => $remote,
]),
0 => t('version <strong>@version</strong> (commit: <strong>@reference</strong>)', [
'@version' => $version,
'@reference' => $reference,
])
],
];

Expand Down
Loading