2011-04-26 20:23:09 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
/*
|
2012-08-09 19:22:15 +00:00
|
|
|
* jQuery Core Release Management
|
2011-04-26 20:23:09 +00:00
|
|
|
*/
|
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
// Debugging variables
|
|
|
|
var debug = false,
|
2012-09-21 01:12:38 +00:00
|
|
|
skipRemote = false;
|
2012-08-09 19:22:15 +00:00
|
|
|
|
2011-04-26 20:23:09 +00:00
|
|
|
var fs = require("fs"),
|
|
|
|
child = require("child_process"),
|
2013-05-12 21:21:31 +00:00
|
|
|
path = require("path"),
|
2013-05-13 01:58:53 +00:00
|
|
|
archiver = require("archiver");
|
2012-08-09 19:22:15 +00:00
|
|
|
|
|
|
|
var releaseVersion,
|
|
|
|
nextVersion,
|
|
|
|
isBeta,
|
|
|
|
pkg,
|
2012-12-16 22:13:17 +00:00
|
|
|
branch,
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
scpURL = "jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/",
|
2011-04-26 20:23:09 +00:00
|
|
|
cdnURL = "http://code.origin.jquery.com/",
|
2012-12-16 23:55:42 +00:00
|
|
|
repoURL = "git@github.com:jquery/jquery.git",
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
// Windows needs the .cmd version but will find the non-.cmd
|
2012-08-30 21:07:03 +00:00
|
|
|
// On Windows, ensure the HOME environment variable is set
|
2012-08-09 19:22:15 +00:00
|
|
|
gruntCmd = process.platform === "win32" ? "grunt.cmd" : "grunt",
|
|
|
|
|
|
|
|
devFile = "dist/jquery.js",
|
2011-04-26 20:23:09 +00:00
|
|
|
minFile = "dist/jquery.min.js",
|
2012-12-29 01:47:33 +00:00
|
|
|
mapFile = "dist/jquery.min.map",
|
2012-08-09 19:22:15 +00:00
|
|
|
|
|
|
|
releaseFiles = {
|
|
|
|
"jquery-VER.js": devFile,
|
|
|
|
"jquery-VER.min.js": minFile,
|
2012-12-29 01:47:33 +00:00
|
|
|
"jquery-VER.min.map": mapFile,
|
2012-08-09 19:22:15 +00:00
|
|
|
"jquery.js": devFile,
|
2011-04-26 20:23:09 +00:00
|
|
|
"jquery.min.js": minFile,
|
2012-12-29 01:47:33 +00:00
|
|
|
"jquery.min.map": mapFile,
|
|
|
|
"jquery-latest.js": devFile,
|
|
|
|
"jquery-latest.min.js": minFile,
|
|
|
|
"jquery-latest.min.map": mapFile
|
2013-05-09 00:00:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
jQueryFilesCDN = [],
|
|
|
|
|
|
|
|
googleFilesCDN = [
|
|
|
|
"jquery.js", "jquery.min.js", "jquery.min.map"
|
|
|
|
],
|
|
|
|
|
|
|
|
msFilesCDN = [
|
|
|
|
"jquery-VER.js", "jquery-VER.min.js", "jquery-VER.min.map"
|
|
|
|
];
|
|
|
|
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
steps(
|
|
|
|
initialize,
|
|
|
|
checkGitStatus,
|
2013-11-14 02:25:37 +00:00
|
|
|
setReleaseVersion,
|
2012-08-09 19:22:15 +00:00
|
|
|
gruntBuild,
|
|
|
|
makeReleaseCopies,
|
2013-05-09 00:00:24 +00:00
|
|
|
copyTojQueryCDN,
|
|
|
|
buildGoogleCDN,
|
|
|
|
buildMicrosoftCDN,
|
2013-11-15 14:19:44 +00:00
|
|
|
createTag,
|
2013-11-14 02:25:37 +00:00
|
|
|
setNextVersion,
|
2012-08-09 19:22:15 +00:00
|
|
|
pushToGithub,
|
2013-11-15 14:19:44 +00:00
|
|
|
// publishToNpm,
|
2012-08-09 19:22:15 +00:00
|
|
|
exit
|
|
|
|
);
|
|
|
|
|
|
|
|
function initialize( next ) {
|
2012-09-21 01:12:38 +00:00
|
|
|
|
|
|
|
if ( process.argv[2] === "-d" ) {
|
|
|
|
process.argv.shift();
|
|
|
|
debug = true;
|
|
|
|
console.warn("=== DEBUG MODE ===" );
|
|
|
|
}
|
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
// First arg should be the version number being released
|
|
|
|
var newver, oldver,
|
2013-11-14 02:25:37 +00:00
|
|
|
exists = fs.existsSync || path.existsSync,
|
2013-05-09 00:00:24 +00:00
|
|
|
rsemver = /^(\d+)\.(\d+)\.(\d+)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/,
|
|
|
|
version = ( process.argv[3] || "" ).toLowerCase().match( rsemver ) || {},
|
2012-08-09 19:22:15 +00:00
|
|
|
major = version[1],
|
|
|
|
minor = version[2],
|
|
|
|
patch = version[3],
|
|
|
|
xbeta = version[4];
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-12-16 22:13:17 +00:00
|
|
|
branch = process.argv[2];
|
|
|
|
releaseVersion = process.argv[3];
|
2012-08-09 19:22:15 +00:00
|
|
|
isBeta = !!xbeta;
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-12-16 22:13:17 +00:00
|
|
|
if ( !branch || !major || !minor || !patch ) {
|
|
|
|
die( "Usage: " + process.argv[1] + " branch releaseVersion" );
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
|
|
|
if ( xbeta === "pre" ) {
|
2012-08-30 21:07:03 +00:00
|
|
|
die( "Cannot release a 'pre' version!" );
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
2013-11-14 02:25:37 +00:00
|
|
|
if ( !exists( "package.json" ) ) {
|
2012-08-09 19:22:15 +00:00
|
|
|
die( "No package.json in this directory" );
|
|
|
|
}
|
2013-11-14 02:25:37 +00:00
|
|
|
pkg = readJSON( "package.json" );
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion );
|
2013-05-09 00:00:24 +00:00
|
|
|
version = pkg.version.match( rsemver );
|
2013-10-07 22:24:02 +00:00
|
|
|
oldver = ( +version[1] ) * 10000 + ( +version[2] * 100 ) + ( +version[3] );
|
2012-08-30 21:07:03 +00:00
|
|
|
newver = ( +major ) * 10000 + ( +minor * 100 ) + ( +patch );
|
2012-08-09 19:22:15 +00:00
|
|
|
if ( newver < oldver ) {
|
|
|
|
die( "Next version is older than current version!" );
|
|
|
|
}
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
nextVersion = major + "." + minor + "." + ( isBeta ? patch : +patch + 1 ) + "-pre";
|
2012-08-09 19:22:15 +00:00
|
|
|
next();
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
function checkGitStatus( next ) {
|
2013-10-07 22:24:02 +00:00
|
|
|
git( [ "status" ], function( error, stdout ) {
|
2012-12-16 22:13:17 +00:00
|
|
|
var onBranch = ((stdout||"").match( /On branch (\S+)/ ) || [])[1];
|
|
|
|
if ( onBranch !== branch ) {
|
2013-05-13 01:58:53 +00:00
|
|
|
dieIfReal( "Branches don't match: Wanted " + branch + ", got " + onBranch );
|
2012-12-16 22:13:17 +00:00
|
|
|
}
|
2012-08-09 19:22:15 +00:00
|
|
|
if ( /Changes to be committed/i.test( stdout ) ) {
|
2013-09-19 13:06:19 +00:00
|
|
|
dieIfReal( "Please commit changed files before attempting to push a release." );
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-08-09 19:22:15 +00:00
|
|
|
if ( /Changes not staged for commit/i.test( stdout ) ) {
|
2013-05-09 00:00:24 +00:00
|
|
|
dieIfReal( "Please stash files before attempting to push a release." );
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-08-09 19:22:15 +00:00
|
|
|
next();
|
2011-04-26 20:23:09 +00:00
|
|
|
});
|
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
function setReleaseVersion( next ) {
|
|
|
|
updateVersion( releaseVersion );
|
|
|
|
git( [ "commit", "-a", "-m", "Updating version to " + releaseVersion + "." ], next, debug );
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
function gruntBuild( next ) {
|
2013-11-14 02:25:37 +00:00
|
|
|
// First clean the dist directory of anything we're not about to rebuild
|
|
|
|
git( [ "clean", "-dfx", "dist/" ], function() {
|
|
|
|
exec( gruntCmd, [], function( error, stdout, stderr ) {
|
|
|
|
if ( error ) {
|
|
|
|
die( error + stderr );
|
|
|
|
}
|
|
|
|
console.log( stdout );
|
|
|
|
next();
|
|
|
|
}, false );
|
|
|
|
}, debug );
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
function makeReleaseCopies( next ) {
|
|
|
|
Object.keys( releaseFiles ).forEach(function( key ) {
|
2012-12-29 01:47:33 +00:00
|
|
|
var text,
|
|
|
|
builtFile = releaseFiles[ key ],
|
2013-05-24 16:37:32 +00:00
|
|
|
unpathedFile = key.replace( /VER/g, releaseVersion ),
|
|
|
|
releaseFile = "dist/" + unpathedFile;
|
2012-08-09 19:22:15 +00:00
|
|
|
|
|
|
|
// Beta releases don't update the jquery-latest etc. copies
|
2013-05-17 02:48:02 +00:00
|
|
|
if ( !isBeta || key.indexOf( "VER" ) >= 0 ) {
|
2012-12-29 01:47:33 +00:00
|
|
|
|
|
|
|
if ( /\.map$/.test( releaseFile ) ) {
|
|
|
|
// Map files need to reference the new uncompressed name;
|
|
|
|
// assume that all files reside in the same directory.
|
|
|
|
// "file":"jquery.min.js","sources":["jquery.js"]
|
|
|
|
text = fs.readFileSync( builtFile, "utf8" )
|
|
|
|
.replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
|
2013-05-24 16:37:32 +00:00
|
|
|
"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) +
|
|
|
|
"\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
|
2013-05-17 02:48:02 +00:00
|
|
|
fs.writeFileSync( releaseFile, text );
|
|
|
|
} else if ( /\.min\.js$/.test( releaseFile ) ) {
|
2013-11-09 22:55:32 +00:00
|
|
|
// Remove the source map comment; it causes way too many problems.
|
|
|
|
// Keep the map file in case DevTools allow manual association.
|
2013-05-17 02:48:02 +00:00
|
|
|
text = fs.readFileSync( builtFile, "utf8" )
|
2013-11-09 22:55:32 +00:00
|
|
|
.replace( /\/\/# sourceMappingURL=\S+/, "" );
|
2013-05-17 02:48:02 +00:00
|
|
|
fs.writeFileSync( releaseFile, text );
|
|
|
|
} else if ( builtFile !== releaseFile ) {
|
|
|
|
copy( builtFile, releaseFile );
|
2012-12-29 01:47:33 +00:00
|
|
|
}
|
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
jQueryFilesCDN.push( releaseFile );
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
2011-04-26 20:23:09 +00:00
|
|
|
});
|
2012-08-09 19:22:15 +00:00
|
|
|
next();
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
function copyTojQueryCDN( next ) {
|
2012-08-09 19:22:15 +00:00
|
|
|
var cmds = [];
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
jQueryFilesCDN.forEach(function( name ) {
|
2012-12-16 22:13:17 +00:00
|
|
|
cmds.push(function( nxt ){
|
|
|
|
exec( "scp", [ name, scpURL ], nxt, debug || skipRemote );
|
2012-08-09 19:22:15 +00:00
|
|
|
});
|
2012-12-16 22:13:17 +00:00
|
|
|
cmds.push(function( nxt ){
|
|
|
|
exec( "curl", [ cdnURL + name + "?reload" ], nxt, debug || skipRemote );
|
2012-08-09 19:22:15 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
cmds.push( next );
|
2013-03-13 23:23:36 +00:00
|
|
|
|
2012-08-30 21:07:03 +00:00
|
|
|
steps.apply( this, cmds );
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
function buildGoogleCDN( next ) {
|
|
|
|
makeArchive( "googlecdn", googleFilesCDN, next );
|
|
|
|
}
|
|
|
|
|
|
|
|
function buildMicrosoftCDN( next ) {
|
|
|
|
makeArchive( "mscdn", msFilesCDN, next );
|
|
|
|
}
|
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
function createTag( next ) {
|
|
|
|
steps(
|
|
|
|
checkoutCommit,
|
|
|
|
commitDistFiles,
|
|
|
|
tagRelease,
|
|
|
|
checkoutBranch,
|
|
|
|
next
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function setNextVersion( next ) {
|
|
|
|
updateVersion( nextVersion );
|
|
|
|
git( [ "commit", "-a", "-m", "Updating the source version to " + nextVersion + "✓™" ], next, debug );
|
|
|
|
}
|
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
function pushToGithub( next ) {
|
2012-12-16 22:13:17 +00:00
|
|
|
git( [ "push", "--tags", repoURL, branch ], next, debug || skipRemote );
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
/* Utilities
|
|
|
|
---------------------------------------------------------------------- */
|
2012-08-09 19:22:15 +00:00
|
|
|
function steps() {
|
|
|
|
var cur = 0,
|
2013-10-07 22:24:02 +00:00
|
|
|
st = arguments;
|
2012-08-09 19:22:15 +00:00
|
|
|
(function next(){
|
2012-12-29 01:47:33 +00:00
|
|
|
process.nextTick(function(){
|
2013-10-07 22:24:02 +00:00
|
|
|
st[ cur++ ]( next );
|
2012-12-29 01:47:33 +00:00
|
|
|
});
|
2012-08-09 19:22:15 +00:00
|
|
|
})();
|
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
function readJSON( filename ) {
|
|
|
|
return JSON.parse( fs.readFileSync( filename ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
function replaceVersionJSON( file, version ) {
|
|
|
|
var text = fs.readFileSync( file, "utf8" );
|
|
|
|
text = text.replace( /("version":\s*")[^"]+/, "$1" + version );
|
|
|
|
fs.writeFileSync( file, text );
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateVersion( ver ) {
|
|
|
|
console.log( "Updating version to " + ver );
|
2012-08-09 19:22:15 +00:00
|
|
|
pkg.version = ver;
|
|
|
|
if ( !debug ) {
|
2013-11-14 02:25:37 +00:00
|
|
|
[ "package.json", "bower.json" ].forEach(function( filename ) {
|
|
|
|
replaceVersionJSON( filename, ver );
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function copy( oldFile, newFile, skip ) {
|
|
|
|
console.log( "Copying " + oldFile + " to " + newFile );
|
|
|
|
if ( !skip ) {
|
|
|
|
fs.writeFileSync( newFile, fs.readFileSync( oldFile, "utf8" ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function exec( cmd, args, fn, skip ) {
|
|
|
|
if ( skip ) {
|
|
|
|
console.log( "# " + cmd + " " + args.join(" ") );
|
|
|
|
fn( "", "", "" );
|
|
|
|
} else {
|
|
|
|
console.log( cmd + " " + args.join(" ") );
|
|
|
|
child.execFile( cmd, args, { env: process.env },
|
|
|
|
function( err, stdout, stderr ) {
|
|
|
|
if ( err ) {
|
|
|
|
die( stderr || stdout || err );
|
|
|
|
}
|
|
|
|
fn.apply( this, arguments );
|
|
|
|
}
|
|
|
|
);
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
function git( args, fn, skip ) {
|
|
|
|
exec( "git", args, fn, skip );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Tag creation
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
function checkoutCommit( next ) {
|
|
|
|
git( [ "checkout", "HEAD^0" ], next, debug );
|
|
|
|
}
|
|
|
|
|
|
|
|
function commitDistFiles( next ) {
|
|
|
|
// Remove scripts property from package.json
|
2013-11-15 15:48:49 +00:00
|
|
|
// Building and bower are irrelevant as those files will be committed
|
|
|
|
// Makes for a clean npm install
|
2013-11-14 02:25:37 +00:00
|
|
|
var pkgClone = readJSON( "package.json" );
|
|
|
|
delete pkgClone.scripts;
|
|
|
|
fs.writeFileSync( "package.json", JSON.stringify( pkgClone, null, "\t" ) );
|
|
|
|
// Add files to be committed
|
2013-11-15 15:48:49 +00:00
|
|
|
git( [ "add", "package.json" ], function() {
|
|
|
|
git( [ "commit", "-m", "Remove scripts property from package.json" ], function() {
|
2013-12-06 20:55:55 +00:00
|
|
|
// Add jquery files for distribution in a final commit
|
|
|
|
git( [ "add", "-f", devFile, minFile, mapFile ], function() {
|
|
|
|
git( [ "commit", "-m", releaseVersion ], next, debug );
|
2013-11-15 15:48:49 +00:00
|
|
|
}, debug );
|
|
|
|
}, debug );
|
2013-11-14 02:25:37 +00:00
|
|
|
}, debug );
|
|
|
|
}
|
|
|
|
|
|
|
|
function tagRelease( next ) {
|
|
|
|
git( [ "tag", releaseVersion ], next, debug );
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkoutBranch( next ) {
|
|
|
|
// Reset files to previous state before leaving the commit
|
|
|
|
git( [ "reset", "--hard", "HEAD" ], function() {
|
|
|
|
git( [ "checkout", branch ], next, debug );
|
|
|
|
}, debug );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Archive creation
|
|
|
|
---------------------------------------------------------------------- */
|
2013-05-09 00:00:24 +00:00
|
|
|
function makeArchive( cdn, files, fn ) {
|
|
|
|
if ( isBeta ) {
|
|
|
|
console.log( "Skipping archive creation for " + cdn + "; " + releaseVersion + " is beta" );
|
|
|
|
process.nextTick( fn );
|
2013-05-12 20:50:54 +00:00
|
|
|
return;
|
2013-05-09 00:00:24 +00:00
|
|
|
}
|
2013-05-12 20:50:54 +00:00
|
|
|
|
|
|
|
console.log( "Creating production archive for " + cdn );
|
|
|
|
|
2013-05-13 01:58:53 +00:00
|
|
|
var archive = archiver( "zip" ),
|
|
|
|
md5file = "dist/" + cdn + "-md5.txt",
|
|
|
|
output = fs.createWriteStream( "dist/" + cdn + "-jquery-" + releaseVersion + ".zip" );
|
2013-05-12 21:21:31 +00:00
|
|
|
|
|
|
|
archive.on( "error", function( err ) {
|
|
|
|
throw err;
|
|
|
|
});
|
|
|
|
|
|
|
|
output.on( "close", fn );
|
2013-05-13 01:58:53 +00:00
|
|
|
archive.pipe( output );
|
2013-05-12 21:21:31 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
files = files.map(function( item ) {
|
|
|
|
return "dist/" + item.replace( /VER/g, releaseVersion );
|
|
|
|
});
|
2013-05-12 20:50:54 +00:00
|
|
|
|
2013-10-07 22:24:02 +00:00
|
|
|
exec( "md5sum", files, function( err, stdout ) {
|
2013-05-09 00:00:24 +00:00
|
|
|
fs.writeFileSync( md5file, stdout );
|
|
|
|
files.push( md5file );
|
2013-05-12 21:21:31 +00:00
|
|
|
|
|
|
|
files.forEach(function( file ) {
|
|
|
|
archive.append( fs.createReadStream( file ), { name: file } );
|
|
|
|
});
|
|
|
|
|
|
|
|
archive.finalize();
|
2013-05-09 00:00:24 +00:00
|
|
|
}, false );
|
|
|
|
}
|
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
/* NPM
|
|
|
|
---------------------------------------------------------------------- */
|
2013-11-15 14:19:44 +00:00
|
|
|
/*
|
2013-11-14 02:25:37 +00:00
|
|
|
function publishToNpm( next ) {
|
|
|
|
// Only publish the master branch to NPM
|
|
|
|
// You must be the jquery npm user for this not to fail
|
|
|
|
// To check, run `npm whoami`
|
|
|
|
// Log in to the jquery user with `npm adduser`
|
|
|
|
if ( branch !== "master" ) {
|
|
|
|
next();
|
|
|
|
return;
|
2012-08-09 19:22:15 +00:00
|
|
|
}
|
2013-11-14 02:25:37 +00:00
|
|
|
git( [ "checkout", releaseVersion ], function() {
|
|
|
|
// Only publish committed files
|
|
|
|
git( [ "clean", "-dfx" ], function() {
|
|
|
|
var args = [ "publish" ];
|
|
|
|
// Tag the version as beta if necessary
|
|
|
|
if ( isBeta ) {
|
|
|
|
args.push( "--tag", "beta" );
|
|
|
|
}
|
|
|
|
exec( "npm", args, function() {
|
|
|
|
git( [ "checkout", branch ], next, debug );
|
|
|
|
}, debug || skipRemote );
|
|
|
|
}, debug );
|
|
|
|
}, debug);
|
2013-11-15 14:19:44 +00:00
|
|
|
}*/
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-11-14 02:25:37 +00:00
|
|
|
/* Death
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
function die( msg ) {
|
|
|
|
console.error( "ERROR: " + msg );
|
|
|
|
process.exit( 1 );
|
2011-04-26 20:23:09 +00:00
|
|
|
}
|
2012-12-29 01:47:33 +00:00
|
|
|
|
2013-05-09 00:00:24 +00:00
|
|
|
function dieIfReal( msg ) {
|
|
|
|
if ( debug ) {
|
|
|
|
console.log ( "DIE: " + msg );
|
|
|
|
} else {
|
|
|
|
die( msg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-09 19:22:15 +00:00
|
|
|
function exit() {
|
|
|
|
process.exit( 0 );
|
|
|
|
}
|