diff --git a/scripts/order-repos/check b/scripts/order-repos/check new file mode 100644 index 0000000..2b92c27 --- /dev/null +++ b/scripts/order-repos/check @@ -0,0 +1,24 @@ +#!/usr/bin/env php +children() as $phar) { + $aliases[] = (string) $phar->attributes()['alias']; +} + +$currentAliases = $aliases; +sort($aliases); + +if ($currentAliases === $aliases) { + fwrite(STDOUT, 'Repositories is ordered properly' . PHP_EOL); + exit(0); +} + +fwrite(STDERR, 'Repositories is NOT ordered by aliases' . PHP_EOL); +exit(1);