diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ba74e78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/build export-ignore diff --git a/build/bump-version.php b/build/bump-version.php new file mode 100644 index 0000000..19c883a --- /dev/null +++ b/build/bump-version.php @@ -0,0 +1,125 @@ +isFile() ) { + updateVersionNumbers($file->getPathname(), $oldVersion, $newVersion); + } + } +} + +//Replace the old version infix in the readme file. +updateVersionNumbers($repositoryRoot . '/README.md', $oldVersion, $newVersion); + +//Rename the loader file and update the version numbers. +$oldLoaderFileName = "load-$oldVersionInfix.php"; +$newLoaderFileName = "load-$newVersionInfix.php"; +exec("git mv $oldLoaderFileName $newLoaderFileName"); +updateVersionNumbers($repositoryRoot . '/' . $newLoaderFileName, $oldVersion, $newVersion); + +//Replace old loader file name with new one in plugin-update-checker.php. +$pluginUpdateCheckerFilePath = $repositoryRoot . '/plugin-update-checker.php'; +$content = file_get_contents($pluginUpdateCheckerFilePath); +$content = str_replace($oldLoaderFileName, $newLoaderFileName, $content); +file_put_contents($pluginUpdateCheckerFilePath, $content); + +// Commit the changes +exec('git add .'); +exec("git commit -m 'Bump version number to $newVersion'"); + +//Switch back to the original branch. +//exec('git checkout -'); + +//Switch back to the original directory. +chdir($oldDir); +