Use platform specific path

Retrieves the platform specific path when getting the project path,
using the right path separators on each platform.
This commit is contained in:
Raul Santos
2021-11-20 14:59:59 +01:00
parent c90dc9caf0
commit 56424b51dd

View File

@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import * as path from 'path';
export interface ProjectLocation{
export interface ProjectLocation {
relativeFilePath: string;
absoluteFilePath: string;
relativeProjectPath: string;
@@ -13,9 +13,9 @@ export async function findProjectFiles(): Promise<ProjectLocation[]> {
return projectFiles.map((x) => {
return {
relativeFilePath: vscode.workspace.asRelativePath(x),
absoluteFilePath: x.path,
absoluteFilePath: x.fsPath,
relativeProjectPath: path.dirname(vscode.workspace.asRelativePath(x)),
absoluteProjectPath: path.dirname(x.path),
absoluteProjectPath: path.dirname(x.fsPath),
};
});
}