1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Do not assume we are on Linux and have head, tail, and awk commands available. Instead, parse the output in PHP.

This commit is contained in:
kthbit 2017-08-12 08:39:35 -05:00
parent de07f33d58
commit 72a66ad9d2

View file

@ -140,9 +140,10 @@ class FossilDriver extends VcsDriver
*/ */
public function getChangeDate($identifier) public function getChangeDate($identifier)
{ {
$this->process->execute(sprintf('fossil finfo composer.json | head -n 2 | tail -n 1 | awk \'{print $1}\''), $output, $this->checkoutDir); $this->process->execute('fossil finfo -b -n 1 composer.json', $output, $this->checkoutDir);
list($ckout, $date, $message) = explode(' ', trim($output), 3);
return new \DateTime(trim($output), new \DateTimeZone('UTC'));
return new \DateTime($date, new \DateTimeZone('UTC'));
} }
/** /**