Skip to content

Commit

Permalink
date time
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 19, 2021
1 parent e2bd8de commit 7a712ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ function (string $filePath, string $prefix, string $content): string {
return $content;
}

$releaseDateTime = VersionResolver::resolverReleaseDateTime();

return strtr(
$content,
[
'@package_version@' => VersionResolver::resolvePackageVersion(),
'@release_date@' => VersionResolver::resolverReleaseDate(),
'@release_date@' => $releaseDateTime->format('Y-m-d H:i:s'),
]
);
},
Expand Down
2 changes: 1 addition & 1 deletion src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function resolvePackageVersion(): string
return trim($process->getOutput());
}

public static function resolverReleaseDate(): DateTimeInterface
public static function resolverReleaseDateTime(): DateTimeInterface
{
$process = new Process(['git', 'log', '-n1', '--pretty=%ci', 'HEAD'], __DIR__);
if ($process->run() !== ShellCode::ERROR) {
Expand Down

0 comments on commit 7a712ba

Please sign in to comment.