Exemple #1
0
    $git = new Git();
    $branch = $git->active_branch();
    if (in_array($branch, $git->mainBranches())) {
        // Only update versions, patches, etc. on specific branches to lessen conflicts
        try {
            // Run DbUpdates to make sure we're up to date.
            $DbUpdater = new DbUpdate(['git' => $git]);
            $DbUpdater->newPatches(['safe' => false]);
        } catch (\Exception $e) {
            $error = 1;
            echo "Error while checking patches!\n";
            echo $e->getMessage() . "\n";
        }
        if ($error === false) {
            try {
                $vers = new Versions();
                $vers->checkAll();
                $vers->save();
                $git->add(NN_VERSIONS);
            } catch (\Exception $e) {
                $error = 1;
                echo "Error while checking versions!\n";
            }
        }
    } else {
        echo "not 'dev', 'dev-regexless', or 'master' branch, skipping version/patch updates\n";
    }
} else {
    echo "Error in pre-commit hooks!!\n";
}
exit($error);
Exemple #2
0
 public static function getValidVersionsFile()
 {
     $versions = new Versions();
     return $versions->getValidVersionsFile();
 }
Exemple #3
0
 *
 * You should have received a copy of the GNU General Public License
 * along with this program (see LICENSE.txt in the base directory.  If
 * not, see:
 *
 * @link <http://www.gnu.org/licenses/>.
 * @author niel
 * @copyright 2014 nZEDb
 */
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
use newznab\utility\Utility;
use newznab\utility\Versions;
if (!Utility::isCLI()) {
    exit;
}
$vers = new Versions();
if (isset($argc) && $argc > 1 && isset($argv[1]) && $argv[1] == true) {
    echo $vers->out->header("Checking versions...");
    if ($vers->checkAll()) {
        $vers->save();
    } else {
        echo "No changes detected.\n";
        output($vers);
    }
} else {
    $vers->checkAll(false);
    echo "Version info in file:\n";
    output($vers);
}
function output($vers)
{