Skip to content

Commit e9269b5

Browse files
fix: ember-source broken links
1 parent f50f4fe commit e9269b5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/helpers/github-link.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ import { helper } from '@ember/component/helper';
22
import githubMap, { mainDir } from '../utils/github-map';
33

44
export function githubLink([project, version, file, line], { isEdit = false }) {
5+
// Adjust version if it's a `v6.0.x` pattern to match the Git tags
6+
const adjustedVersion = version.startsWith('v6.0.')
7+
? `${version}-ember-source`
8+
: version;
9+
510
if (isEdit) {
611
return `https://github.com/${githubMap[project]}/edit/release${mainDir(
712
project,
8-
version
13+
adjustedVersion
914
)}${file}#L${line}`;
1015
}
1116

@@ -22,9 +27,9 @@ export function githubLink([project, version, file, line], { isEdit = false }) {
2227
// 'https://github.com/emberjs/data/tree/v4.10.0/packages/packages/store/addon/-private/record-arrays/identifier-array.ts#L118'
2328
const fixedFile = file?.replace('../packages/', '../');
2429

25-
return `https://github.com/${githubMap[project]}/tree/v${version}${mainDir(
30+
return `https://github.com/${githubMap[project]}/tree/${adjustedVersion}${mainDir(
2631
project,
27-
version
32+
adjustedVersion
2833
)}${fixedFile}#L${line}`;
2934
}
3035

0 commit comments

Comments
 (0)