use absolute path (#6483)

This commit is contained in:
Alan Ren
2019-07-23 21:26:01 -07:00
committed by GitHub
parent a1a67b1a86
commit 059e80003d
3 changed files with 7 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ export interface INotebookService {
export class NotebookService implements INotebookService {
constructor(private platformService: IPlatformService) { }
constructor(private platformService: IPlatformService, private extensionPath: string) { }
/**
* Copy the notebook to the user's home directory and launch the notebook from there.
@@ -27,7 +27,7 @@ export class NotebookService implements INotebookService {
*/
launchNotebook(notebook: string | NotebookInfo): void {
const notebookRelativePath = this.getNotebook(notebook);
const notebookFullPath = path.join(__dirname, '../../', notebookRelativePath);
const notebookFullPath = path.join(this.extensionPath, notebookRelativePath);
if (notebookRelativePath && this.platformService.fileExists(notebookFullPath)) {
this.showNotebookAsUntitled(notebookFullPath);
}