2017-07-12 05:52:42 -04:00
< ? php
/**
2024-05-10 09:09:14 -04:00
* SPDX - FileCopyrightText : 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX - License - Identifier : AGPL - 3.0 - or - later
2017-07-12 05:52:42 -04:00
*/
$expectedFiles = [
2021-12-02 12:57:11 -05:00
'.' ,
2022-12-21 12:18:46 -05:00
'..' ,
2021-02-09 05:22:29 -05:00
'.devcontainer' ,
2017-07-12 05:52:42 -04:00
'.drone.yml' ,
2019-11-07 19:28:39 -05:00
'.editorconfig' ,
2021-03-17 03:19:11 -04:00
'.eslintignore' ,
2019-10-02 05:07:09 -04:00
'.eslintrc.js' ,
2017-07-12 05:52:42 -04:00
'.git' ,
2018-12-21 05:02:22 -05:00
'.gitattributes' ,
2017-07-12 05:52:42 -04:00
'.github' ,
'.gitignore' ,
'.gitmodules' ,
'.htaccess' ,
'.idea' ,
'.jshintrc' ,
'.mailmap' ,
2021-05-16 11:56:50 -04:00
'.npmignore' ,
2022-01-14 03:05:41 -05:00
'.php-cs-fixer.dist.php' ,
2022-09-30 08:27:36 -04:00
'.pre-commit-config.yaml' ,
2024-05-09 14:34:22 -04:00
'.reuse' ,
2017-07-12 05:52:42 -04:00
'.scrutinizer.yml' ,
'.tag' ,
2017-08-25 11:48:04 -04:00
'.tx' ,
2017-07-12 05:52:42 -04:00
'.user.ini' ,
2023-06-21 04:14:34 -04:00
'__mocks__' ,
'__tests__' ,
2017-07-12 05:52:42 -04:00
'3rdparty' ,
2024-05-10 13:16:41 -04:00
'AUTHORS' ,
2022-12-21 12:18:46 -05:00
'CHANGELOG.md' ,
'CODE_OF_CONDUCT.md' ,
'COPYING' ,
2024-05-10 13:16:41 -04:00
'COPYING-README' ,
2022-12-21 12:18:46 -05:00
'DESIGN.md' ,
'Makefile' ,
'README.md' ,
'SECURITY.md' ,
'apps' ,
2017-07-12 05:52:42 -04:00
'autotest-checkers.sh' ,
'autotest-external.sh' ,
'autotest.sh' ,
2019-05-23 11:03:04 -04:00
'babel.config.js' ,
2017-07-12 05:52:42 -04:00
'build' ,
2023-06-21 04:14:34 -04:00
'codecov.yml' ,
2017-07-12 05:52:42 -04:00
'composer.json' ,
2020-03-27 11:54:07 -04:00
'composer.lock' ,
2017-07-12 05:52:42 -04:00
'config' ,
'console.php' ,
'contribute' ,
'core' ,
'cron.php' ,
2023-04-05 03:12:08 -04:00
'custom.d.ts' ,
2022-12-21 12:18:46 -05:00
'cypress.config.ts' ,
2023-04-05 03:12:08 -04:00
'cypress.d.ts' ,
'cypress' ,
2021-12-02 12:57:11 -05:00
'dist' ,
2017-07-12 05:52:42 -04:00
'index.html' ,
'index.php' ,
2023-06-21 04:14:34 -04:00
'jest.config.ts' ,
2017-07-12 05:52:42 -04:00
'lib' ,
2024-05-09 14:34:22 -04:00
'LICENSES' ,
2017-07-12 05:52:42 -04:00
'occ' ,
2019-10-02 05:07:09 -04:00
'ocs' ,
2022-12-21 12:18:46 -05:00
'ocs-provider' ,
2018-12-21 05:02:22 -05:00
'package-lock.json' ,
2019-10-02 05:07:09 -04:00
'package.json' ,
2020-12-30 08:32:15 -05:00
'psalm-ocp.xml' ,
2021-12-02 12:57:11 -05:00
'psalm.xml' ,
2017-07-12 05:52:42 -04:00
'public.php' ,
'remote.php' ,
'resources' ,
'robots.txt' ,
'status.php' ,
'tests' ,
'themes' ,
2022-11-29 03:51:34 -05:00
'tsconfig.json' ,
2021-08-19 04:48:44 -04:00
'vendor-bin' ,
2017-07-12 05:52:42 -04:00
'version.php' ,
2022-12-28 13:08:54 -05:00
'webpack.common.js' ,
2022-12-28 09:29:54 -05:00
'webpack.config.js' ,
2021-12-02 12:57:11 -05:00
'webpack.modules.js' ,
2017-07-12 05:52:42 -04: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 );