diff --git a/build/patchtester/build.sh b/build/patchtester/build.sh index 7d686a4..c2e201e 100755 --- a/build/patchtester/build.sh +++ b/build/patchtester/build.sh @@ -16,3 +16,4 @@ tar zcf ../packages/com_patchtester.tar.gz . zip -r ../packages/com_patchtester.zip . cd ../../ composer install +php build/patchtester/hash_generator.php diff --git a/build/patchtester/hash_generator.php b/build/patchtester/hash_generator.php new file mode 100755 index 0000000..e086994 --- /dev/null +++ b/build/patchtester/hash_generator.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +isDir() || $file->isDot()) + { + continue; + } + + $hashes[$file->getFilename()] = array( + 'sha384' => hash_file('sha384', $file->getPathname()), + ); +} + +$jsonOptions = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT : 0; + +@file_put_contents($packageDir . '/checksums.json', json_encode($hashes, $jsonOptions)); + +echo 'Checksums file generated' . PHP_EOL . PHP_EOL;