Skip to content

Commit

Permalink
fix(generate_docs): fix travis: support yalc versions by matching and…
Browse files Browse the repository at this point in the history
… stripping the '-ha5hcod3' suffix
  • Loading branch information
christopherthielen committed Apr 21, 2018
1 parent 74217d6 commit 2e9d9d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions generate_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const TS_CONFIG = JSON.parse(fs.readFileSync('./tsconfig.json'));
const TYPEDOC_CONFIG = JSON.parse(fs.readFileSync('./typedoc.json'));
const PACKAGE_DIR = process.cwd();
const DOWNSTREAM_CACHE = path.join(PACKAGE_DIR, '.downstream_cache');
const IS_TRAVIS = !!process.env.TRAVIS;
const DOCGEN_DIR = tmp.dirSync().name;
const DOCGEN_PACKAGE_DIR = path.join(DOCGEN_DIR, kebob(PACKAGE_JSON.name));

Expand Down Expand Up @@ -51,8 +50,13 @@ includes.forEach(include => {
const flags = { noBuild: true, noPublish: true, noInstall: true, branch: branch };

if (!branch) {
const versionline = _exec(`yarn list --pattern ${package}`).stdout.split(/[\r\n]+/).find(line => line.includes(package));
const version = /.*\@([^@]*)/.exec(versionline)[ 1 ];
const versionline = _exec(`yarn list --pattern ${package}`).stdout
.split(/[\r\n]+/).find(line => line.includes(package));
const match = /.*\@(([^@]*?)(-[a-zA-Z0-9]{8})?$)/.exec(versionline);
const version = match[2];
console.log({ versionline });
console.log({ match });
console.log({ version });
flags.branch = version ? version : flags.branch;
}

Expand Down

0 comments on commit 2e9d9d7

Please sign in to comment.