2017-07-12 11:52:42 +02:00
< ? php
2025-02-21 12:12:29 +01:00
declare ( strict_types = 1 );
2017-07-12 11:52:42 +02:00
/**
2024-05-10 15:09:14 +02:00
* SPDX - FileCopyrightText : 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX - License - Identifier : AGPL - 3.0 - or - later
2017-07-12 11:52:42 +02:00
*/
$expectedFiles = [
2021-12-02 18:57:11 +01:00
'.' ,
2022-12-21 18:18:46 +01:00
'..' ,
2021-02-09 11:22:29 +01:00
'.devcontainer' ,
2019-11-08 08:28:39 +08: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' ,
2024-08-25 18:52:30 +02:00
'.git-blame-ignore-revs' ,
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' ,
2022-09-30 14:27:36 +02:00
'.pre-commit-config.yaml' ,
2024-05-09 20:34:22 +02:00
'.reuse' ,
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' ,
2023-06-21 10:14:34 +02:00
'__mocks__' ,
'__tests__' ,
2017-07-12 11:52:42 +02:00
'3rdparty' ,
2024-05-10 19:16:41 +02:00
'AUTHORS' ,
2022-12-21 18:18:46 +01:00
'CHANGELOG.md' ,
'CODE_OF_CONDUCT.md' ,
'COPYING' ,
2024-05-10 19:16:41 +02:00
'COPYING-README' ,
2022-12-21 18:18:46 +01:00
'DESIGN.md' ,
'Makefile' ,
'README.md' ,
'SECURITY.md' ,
'apps' ,
2017-07-12 11:52:42 +02:00
'autotest-checkers.sh' ,
'autotest-external.sh' ,
'autotest.sh' ,
2019-05-23 17:03:04 +02:00
'babel.config.js' ,
2017-07-12 11:52:42 +02:00
'build' ,
2023-06-21 10:14:34 +02:00
'codecov.yml' ,
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' ,
'core' ,
'cron.php' ,
2023-04-05 09:12:08 +02:00
'custom.d.ts' ,
2022-12-21 18:18:46 +01:00
'cypress.config.ts' ,
2023-04-05 09:12:08 +02:00
'cypress.d.ts' ,
'cypress' ,
2021-12-02 18:57:11 +01:00
'dist' ,
2017-07-12 11:52:42 +02:00
'index.html' ,
'index.php' ,
'lib' ,
2024-05-09 20:34:22 +02:00
'LICENSES' ,
2017-07-12 11:52:42 +02:00
'occ' ,
2019-10-02 11:07:09 +02:00
'ocs' ,
2022-12-21 18:18:46 +01:00
'ocs-provider' ,
2018-12-21 11:02:22 +01:00
'package-lock.json' ,
2019-10-02 11:07:09 +02:00
'package.json' ,
2024-11-12 11:39:56 +01:00
'psalm-ncu.xml' ,
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' ,
'remote.php' ,
'resources' ,
'robots.txt' ,
'status.php' ,
2024-08-27 21:56:15 +02:00
'stylelint.config.js' ,
2017-07-12 11:52:42 +02:00
'tests' ,
'themes' ,
2022-11-29 09:51:34 +01:00
'tsconfig.json' ,
2021-08-19 10:48:44 +02:00
'vendor-bin' ,
2017-07-12 11:52:42 +02:00
'version.php' ,
2024-08-26 14:10:25 +02:00
'vitest.config.ts' ,
2022-12-28 19:08:54 +01:00
'webpack.common.js' ,
2022-12-28 15:29:54 +01:00
'webpack.config.js' ,
2021-12-02 18:57:11 +01:00
'webpack.modules.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 );