Skip to content

Commit

Permalink
Merge pull request #405 from conwnet/master
Browse files Browse the repository at this point in the history
release 0.7.2
  • Loading branch information
conwnet authored May 18, 2022
2 parents a6d68db + bed1a6c commit 8ac2f3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions extensions/github1s/src/adapters/sourcegraph/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ export class SourcegraphDataSource extends DataSource {
});

async provideFile(repo: string, ref: string, path: string): Promise<File> {
const { content, binary } = await readFile(this.buildRepository(repo), ref, path);
// sourcegraph api break binary files, so we use github api here
// TODO: fix fetch binary files in gitlab/bitbucket
if (binary && this.platform === 'github') {
// sourcegraph api break binary files and text coding, so we use github api here
if (this.platform === 'github') {
return fetch(`https://raw.githubusercontent.com/${repo}/${ref}/${path}`)
.then((response) => response.arrayBuffer())
.then((buffer) => ({ content: new Uint8Array(buffer) }));
}
// TODO: support binary files for other platforms
const { content } = await readFile(this.buildRepository(repo), ref, path);
return { content: this.textEncodder.encode(content) };
}

Expand Down
4 changes: 2 additions & 2 deletions resources/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
} else if (hostname.match(/\.?bitbucket1s\.org$/)) {
scheme = 'bitbucket1s';
platformName = 'Bitbucket';
platformOrigin = 'https://bitbucket1s.com';
platformOrigin = 'https://bitbucket.org';
logoIcon = staticAssetsPrefix + '/config/bitbucket.svg';
repository = pathParts >= 2 ? pathParts.slice(0, 2).join('/') : 'atlassian/clover';
}
Expand Down Expand Up @@ -218,7 +218,7 @@
icon: logoIcon,
title: 'Open on ' + platformName,
onClick() {
const pathname = window.location.pathname > 1 ? window.location.pathname : '/' + repository;
const pathname = window.location.pathname.length > 1 ? window.location.pathname : '/' + repository;
const targetPath = pathname + window.location.search + window.location.hash;
window.open(platformOrigin + targetPath, '_blank');
},
Expand Down

1 comment on commit 8ac2f3b

@vercel
Copy link

@vercel vercel bot commented on 8ac2f3b May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.