Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ember-source broken links #933

Merged
11 changes: 8 additions & 3 deletions app/helpers/github-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
import githubMap, { mainDir } from '../utils/github-map';

export function githubLink([project, version, file, line], { isEdit = false }) {
// Adjust version if it's a `v6.0.x` pattern to match the Git tags
const adjustedVersion = version.startsWith('v6.0.')
MehulKChaudhari marked this conversation as resolved.
Show resolved Hide resolved
? `${version}-ember-source`
: version;

if (isEdit) {
return `https://github.com/${githubMap[project]}/edit/release${mainDir(
project,
version
adjustedVersion
)}${file}#L${line}`;
}

Expand All @@ -22,9 +27,9 @@
// 'https://github.com/emberjs/data/tree/v4.10.0/packages/packages/store/addon/-private/record-arrays/identifier-array.ts#L118'
const fixedFile = file?.replace('../packages/', '../');

return `https://github.com/${githubMap[project]}/tree/v${version}${mainDir(
return `https://github.com/${githubMap[project]}/tree/${adjustedVersion}${mainDir(

Check failure on line 30 in app/helpers/github-link.js

View workflow job for this annotation

GitHub Actions / Lint files

Replace `githubMap[project]` with `⏎····githubMap[project]⏎··`
project,
version
adjustedVersion
)}${fixedFile}#L${line}`;
}

Expand Down
Loading