beachball
Advanced tools
Comparing version
# Changelog - beachball | ||
This log was last generated on Fri, 14 Jun 2019 19:35:51 GMT and should not be manually modified. | ||
This log was last generated on Mon, 17 Jun 2019 17:36:58 GMT and should not be manually modified. | ||
## 1.5.1 | ||
Mon, 17 Jun 2019 17:36:58 GMT | ||
### Patches | ||
- Be more specific in publish to disambiguate the tag and target branch (kchau@microsoft.com) | ||
## 1.5.0 | ||
Fri, 14 Jun 2019 19:35:51 GMT | ||
Fri, 14 Jun 2019 19:35:56 GMT | ||
@@ -8,0 +15,0 @@ ### Minor |
@@ -13,2 +13,4 @@ export declare function git(args: string[], options?: { | ||
export declare function getBranchName(cwd: string): string | null; | ||
export declare function getFullBranchRef(branch: string, cwd: string): string | null; | ||
export declare function getShortBranchName(fullBranchRef: string, cwd: string): string | null; | ||
export declare function getCurrentHash(cwd: string): string | null; | ||
@@ -15,0 +17,0 @@ export declare function stageAndCommit(patterns: string[], message: string, cwd: string): void; |
@@ -96,2 +96,18 @@ "use strict"; | ||
exports.getBranchName = getBranchName; | ||
function getFullBranchRef(branch, cwd) { | ||
const showRefResults = git(['show-ref', '--heads', branch], { cwd }); | ||
if (showRefResults.success) { | ||
return showRefResults.stdout.split(' ')[1]; | ||
} | ||
return null; | ||
} | ||
exports.getFullBranchRef = getFullBranchRef; | ||
function getShortBranchName(fullBranchRef, cwd) { | ||
const showRefResults = git(['name-rev', '--name-only', fullBranchRef], { cwd }); | ||
if (showRefResults.success) { | ||
return showRefResults.stdout; | ||
} | ||
return null; | ||
} | ||
exports.getShortBranchName = getShortBranchName; | ||
function getCurrentHash(cwd) { | ||
@@ -98,0 +114,0 @@ try { |
@@ -21,3 +21,10 @@ "use strict"; | ||
const { path: cwd, branch, registry, tag, token, message, access } = options; | ||
const remoteFullBranchName = git_1.getRemoteBranch(branch, cwd); | ||
const targetBranchRef = git_1.getFullBranchRef(branch, cwd); | ||
if (!targetBranchRef) { | ||
console.error(`Target branch does not exist: ${targetBranchRef}`); | ||
process.exit(1); | ||
// return here to appease the TS compiler errors, but we both know that process has already exited... shhh... | ||
return; | ||
} | ||
const remoteFullBranchName = git_1.getRemoteBranch(git_1.getShortBranchName(targetBranchRef, cwd), cwd); | ||
console.log(`Publishing from beachball | ||
@@ -27,3 +34,3 @@ | ||
current branch: ${git_1.getBranchName(cwd)} | ||
target branch: ${branch} | ||
target branch: ${branch} (${targetBranchRef}) | ||
remote tracked branch: ${remoteFullBranchName || '[not tracking a remote]'} | ||
@@ -100,4 +107,6 @@ tag: ${tag} | ||
tagPackages(bumpInfo, tag, cwd); | ||
console.log(`pushing to ${remoteFullBranchName}`); | ||
git_1.git(['push', '--follow-tags', remote, `${branch}:${remoteBranch}`]); | ||
console.log(`pushing to ${remoteFullBranchName}, running the following command for git push:`); | ||
const pushArgs = ['push', '--follow-tags', remote, `${targetBranchRef}:${remoteBranch}`]; | ||
console.log('git ' + pushArgs.join(' ')); | ||
git_1.git(pushArgs); | ||
} | ||
@@ -104,0 +113,0 @@ }); |
{ | ||
"name": "beachball", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59737
2.72%1273
2.17%