Yet another fix for CI to find branch that contaisn tag latest

Reviewed By: svcscm

Differential Revision: D2937802

fb-gh-sync-id: 3bd617d5fc7fea42d264acfbd229fd15b335a95d
shipit-source-id: 3bd617d5fc7fea42d264acfbd229fd15b335a95d
This commit is contained in:
Konstantin Raev
2016-02-15 13:07:36 -08:00
committed by facebook-github-bot-5
parent e5ba46c30d
commit ecb1643fee
3 changed files with 5 additions and 7 deletions

View File

@@ -35,10 +35,10 @@ mkdir(`-p`, `build`);
const currentCommit = exec(`git rev-parse HEAD`).stdout.trim();
const latestTagCommit = exec(`git ls-remote origin latest`).stdout.split(/\s/)[0];
// pass along which branch contains latest version so that gh-pages root could mark it as latest
const branchWithLatestTag = exec(`git branch --contains latest`).stdout;
const branchWithLatestTag = exec(`git branch -r --contains ${latestTagCommit}`).stdout.split('/')[1];
let latestVersion = ``;
if (branchWithLatestTag.indexOf(`-stable`) !== -1) {
latestVersion = branchWithLatestTag.slice(0, branchWithLatestTag.indexOf(`-stable`)).trim();
latestVersion = branchWithLatestTag.slice(0, branchWithLatestTag.indexOf(`-stable`));
}
if (!CI_PULL_REQUEST && CIRCLE_PROJECT_USERNAME === `facebook`) {

View File

@@ -24,7 +24,7 @@ var versions = React.createClass({
].concat(availableDocs.map((version) => {
const isLatest = Metadata.config.RN_LATEST_VERSION === version;
return {
title: isLatest ? `${version} + (current)` : version,
title: isLatest ? `${version} (current)` : version,
path: isLatest ? '/react-native' : '/react-native/releases/' + version
}
}));