Skip to content

Commit 2e9d9d7

Browse files
fix(generate_docs): fix travis: support yalc versions by matching and stripping the '-ha5hcod3' suffix
1 parent 74217d6 commit 2e9d9d7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

generate_docs.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const TS_CONFIG = JSON.parse(fs.readFileSync('./tsconfig.json'));
2222
const TYPEDOC_CONFIG = JSON.parse(fs.readFileSync('./typedoc.json'));
2323
const PACKAGE_DIR = process.cwd();
2424
const DOWNSTREAM_CACHE = path.join(PACKAGE_DIR, '.downstream_cache');
25-
const IS_TRAVIS = !!process.env.TRAVIS;
2625
const DOCGEN_DIR = tmp.dirSync().name;
2726
const DOCGEN_PACKAGE_DIR = path.join(DOCGEN_DIR, kebob(PACKAGE_JSON.name));
2827

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

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

0 commit comments

Comments
 (0)