2017-07-12 11:52:42 +02:00
< ? php
/**
* @ copyright Copyright ( c ) 2017 Morris Jobke < hey @ morrisjobke . de >
*
* @ license GNU AGPL version 3 or any later version
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU Affero General Public License for more details .
*
* You should have received a copy of the GNU Affero General Public License
* along with this program . If not , see < http :// www . gnu . org / licenses />.
*
*/
$expectedFiles = [
'..' ,
2021-12-02 18:57:11 +01:00
'.' ,
2017-07-12 11:52:42 +02:00
'.codecov.yml' ,
2021-02-09 11:22:29 +01:00
'.devcontainer' ,
2017-07-12 11:52:42 +02:00
'.drone.yml' ,
2019-11-08 01:28:39 +01:00
'.editorconfig' ,
2021-03-17 08:19:11 +01:00
'.eslintignore' ,
2019-10-02 11:07:09 +02:00
'.eslintrc.js' ,
2017-07-12 11:52:42 +02:00
'.git' ,
2018-12-21 11:02:22 +01:00
'.gitattributes' ,
2017-07-12 11:52:42 +02:00
'.github' ,
'.gitignore' ,
'.gitmodules' ,
'.htaccess' ,
'.idea' ,
'.jshintrc' ,
'.mailmap' ,
2021-05-16 17:56:50 +02:00
'.npmignore' ,
2022-01-14 09:05:41 +01:00
'.php-cs-fixer.dist.php' ,
2017-07-12 11:52:42 +02:00
'.scrutinizer.yml' ,
'.tag' ,
2017-08-25 17:48:04 +02:00
'.tx' ,
2017-07-12 11:52:42 +02:00
'.user.ini' ,
'3rdparty' ,
'apps' ,
'AUTHORS' ,
'autotest-checkers.sh' ,
'autotest-external.sh' ,
'autotest-js.sh' ,
'autotest.sh' ,
2019-05-23 17:03:04 +02:00
'babel.config.js' ,
2017-07-12 11:52:42 +02:00
'build' ,
'CHANGELOG.md' ,
2018-01-10 11:03:12 +01:00
'CODE_OF_CONDUCT.md' ,
2017-07-12 11:52:42 +02:00
'composer.json' ,
2020-03-27 16:54:07 +01:00
'composer.lock' ,
2017-07-12 11:52:42 +02:00
'config' ,
'console.php' ,
'contribute' ,
'COPYING-README' ,
2019-10-02 11:07:09 +02:00
'COPYING' ,
2017-07-12 11:52:42 +02:00
'core' ,
'cron.php' ,
2021-12-02 18:57:11 +01:00
'dist' ,
2017-07-12 11:52:42 +02:00
'index.html' ,
'index.php' ,
2022-05-25 12:39:08 +02:00
'jest.config.js' ,
2017-07-12 11:52:42 +02:00
'lib' ,
2019-02-25 15:49:29 +01:00
'Makefile' ,
2017-07-12 11:52:42 +02:00
'occ' ,
2018-06-11 11:23:16 +02:00
'ocm-provider' ,
2019-10-02 11:07:09 +02:00
'ocs-provider' ,
'ocs' ,
2018-12-21 11:02:22 +01:00
'package-lock.json' ,
2019-10-02 11:07:09 +02:00
'package.json' ,
2020-12-30 14:32:15 +01:00
'psalm-ocp.xml' ,
2021-12-02 18:57:11 +01:00
'psalm.xml' ,
2017-07-12 11:52:42 +02:00
'public.php' ,
'README.md' ,
'remote.php' ,
'resources' ,
'robots.txt' ,
2019-12-22 21:21:18 +01:00
'SECURITY.md' ,
2017-07-12 11:52:42 +02:00
'status.php' ,
'tests' ,
'themes' ,
2021-08-19 10:48:44 +02:00
'vendor-bin' ,
2017-07-12 11:52:42 +02:00
'version.php' ,
2019-02-12 20:16:43 +01:00
'webpack.common.js' ,
'webpack.dev.js' ,
2021-12-02 18:57:11 +01:00
'webpack.modules.js' ,
2019-02-12 20:16:43 +01:00
'webpack.prod.js' ,
2017-07-12 11:52:42 +02:00
];
$actualFiles = [];
$files = new \DirectoryIterator ( __DIR__ . '/..' );
foreach ( $files as $file ) {
$actualFiles [] = $file -> getFilename ();
}
$additionalFiles = array_diff ( $actualFiles , $expectedFiles );
$missingFiles = array_diff ( $expectedFiles , $actualFiles );
$failed = false ;
if ( count ( $additionalFiles ) > 0 ) {
echo sprintf ( 'ERROR: There were %d additional files:' , count ( $additionalFiles )) . PHP_EOL ;
echo implode ( PHP_EOL , $additionalFiles ) . PHP_EOL ;
$failed = true ;
}
if ( count ( $missingFiles ) > 0 ) {
echo sprintf ( 'ERROR: There were %d missing files:' , count ( $missingFiles )) . PHP_EOL ;
echo implode ( PHP_EOL , $missingFiles ) . PHP_EOL ;
$failed = true ;
}
if ( $failed ) {
echo 'ERROR: Please remove or add those files again or inform the release team about those now files to be included or excluded from the release tar ball.' . PHP_EOL ;
exit ( 1 );
}
echo 'OK: all expected files are present and no additional files are there.' . PHP_EOL ;
exit ( 0 );