|
4 | 4 | // Usage:
|
5 | 5 | // stable release: node release.js
|
6 | 6 | // pre-release: node release.js --pre-release {version}
|
| 7 | +// test run: node release.js --remote=user/repo |
7 | 8 |
|
8 | 9 | "use strict";
|
9 | 10 |
|
10 |
| -var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, preRelease, |
| 11 | +var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, preRelease, repo, |
11 | 12 | fs = require( "fs" ),
|
12 | 13 | rnewline = /\r?\n/,
|
13 |
| - repo = "git@github.com:jquery/jquery-ui.git", |
14 | 14 | branch = "master";
|
15 | 15 |
|
16 | 16 | walk([
|
@@ -357,6 +357,44 @@ function writePackage( pkg ) {
|
357 | 357 | }
|
358 | 358 |
|
359 | 359 | function bootstrap( fn ) {
|
| 360 | + getRemote(function( remote ) { |
| 361 | + repo = "git@github.com:" + remote + ".git"; |
| 362 | + _bootstrap( fn ); |
| 363 | + }); |
| 364 | +} |
| 365 | + |
| 366 | +function getRemote( fn ) { |
| 367 | + var matches, remote; |
| 368 | + |
| 369 | + console.log( "Determining remote repo..." ); |
| 370 | + process.argv.forEach(function( arg ) { |
| 371 | + matches = /--remote=(.+)/.exec( arg ); |
| 372 | + if ( matches ) { |
| 373 | + remote = matches[ 1 ]; |
| 374 | + } |
| 375 | + }); |
| 376 | + |
| 377 | + if ( remote ) { |
| 378 | + fn( remote ); |
| 379 | + return; |
| 380 | + } |
| 381 | + |
| 382 | + console.log(); |
| 383 | + console.log( " !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); |
| 384 | + console.log( " !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); |
| 385 | + console.log( " !! !!" ); |
| 386 | + console.log( " !! Using jquery/jquery-ui !!" ); |
| 387 | + console.log( " !! !!" ); |
| 388 | + console.log( " !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); |
| 389 | + console.log( " !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); |
| 390 | + console.log(); |
| 391 | + console.log( "Press enter to continue, or ctrl+c to cancel." ); |
| 392 | + prompt(function() { |
| 393 | + fn( "jquery/jquery-ui" ); |
| 394 | + }); |
| 395 | +} |
| 396 | + |
| 397 | +function _bootstrap( fn ) { |
360 | 398 | console.log( "Determining release type..." );
|
361 | 399 | preRelease = process.argv.indexOf( "--pre-release" );
|
362 | 400 | if ( preRelease !== -1 ) {
|
|
0 commit comments