Skip to content

Commit

Permalink
Made a useful new command for mangling version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed Mar 4, 2015
1 parent 405009a commit b73aca8
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tools/commands-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,61 @@ main.registerCommand({
});
});

///////////////////////////////////////////////////////////////////////////////
// admin check-package-versions
///////////////////////////////////////////////////////////////////////////////

// Run before publish-release --from-checkout to make sure that all of our
// version numbers are up to date
main.registerCommand({
name: 'admin check-package-versions',
hidden: true,
catalogRefresh: new catalog.Refresh.OnceAtStart({ ignoreErrors: false })
}, function (options) {
if (!files.inCheckout()) {
Console.error("Must run from checkout.");
return 1;
};

// Set up a temporary project context and build everything.
var tempProjectDir = files.mkdtemp('meteor-release-build');
var projectContext = new projectContextModule.ProjectContext({
projectDir: tempProjectDir, // won't have a packages dir, that's OK
// seriously, we only want checkout packages
ignorePackageDirsEnvVar: true,
// When we publish, we should always include web.cordova unibuilds, even
// though this temporary directory does not have any cordova platforms
forceIncludeCordovaUnibuild: true
});

// Read metadata and initialize catalog.
main.captureAndExit("=> Errors while building for release:", function () {
projectContext.initializeCatalog();
});

// Ensure that all packages and their tests are built. (We need to build
// tests so that we can include their sources in source tarballs.)
var allPackagesWithTests = projectContext.localCatalog.getAllPackageNames();
var allPackages = projectContext.localCatalog.getAllNonTestPackageNames();
projectContext.projectConstraintsFile.addConstraints(
_.map(allPackagesWithTests, function (p) {
return utils.parsePackageConstraint(p);
})
);

Console.info("Listing packages where the checkout version doesn't match the",
"latest version on the package server.");

_.each(allPackages, function (packageName) {
var checkoutVersion = projectContext.localCatalog.getLatestVersion(packageName).version;
var remoteLatestVersion = catalog.official.getLatestVersion(packageName).version;

if (checkoutVersion !== remoteLatestVersion) {
Console.info(packageName, checkoutVersion, remoteLatestVersion);
}
});
});

///////////////////////////////////////////////////////////////////////////////
// add
///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit b73aca8

Please sign in to comment.