Skip to content

Commit e0a4261

Browse files
authored
Open filepath relative to repo root
1 parent c921d71 commit e0a4261

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const gitPullerExtension: JupyterFrontEndPlugin<void> = {
6464
const basePath = PathExt.basename(repo);
6565
const branch = urlParams.get('branch') || 'main';
6666
const provider = urlParams.get('provider') || 'github';
67-
let filePath = urlParams.get('urlpath');
67+
const filePath = urlParams.get('urlpath');
6868

6969
const repoUrl = new URL(repo);
7070
if (provider === 'github') {
@@ -97,10 +97,8 @@ const gitPullerExtension: JupyterFrontEndPlugin<void> = {
9797

9898
puller.clone(repoUrl.href, branch, basePath).then(async basePath => {
9999
if (filePath) {
100-
// TODO: delete the following line as soon as a dedicated url generator is available.
101-
filePath = PathExt.relative('tree/', filePath);
102100
app.commands.execute('filebrowser:open-path', {
103-
path: filePath
101+
path: PathExt.join(basePath, filePath)
104102
});
105103
}
106104
});

0 commit comments

Comments
 (0)