From 1fd50f9f034add15187c521a9effb18afc595b80 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 29 Feb 2024 14:09:12 -0500 Subject: [PATCH] Fix path issue on windows --- src/viewProviders/RokuAppOverlaysViewViewProvider.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/viewProviders/RokuAppOverlaysViewViewProvider.ts b/src/viewProviders/RokuAppOverlaysViewViewProvider.ts index b177a19d..fd177949 100644 --- a/src/viewProviders/RokuAppOverlaysViewViewProvider.ts +++ b/src/viewProviders/RokuAppOverlaysViewViewProvider.ts @@ -26,15 +26,16 @@ export class RokuAppOverlaysViewViewProvider extends BaseRdbViewProvider { Images: ['png', 'jpg', 'jpeg', 'webp', 'bmp', 'gif'] } }; - const [file] = await vscode.window.showOpenDialog(options); - const name = path.basename(file.path); - const extension = path.extname(file.path); - const destinationFileName = path.basename(file.path, extension) + '_' + Date.now() + extension; + const filePath = (await vscode.window.showOpenDialog(options))[0]?.fsPath; + + const name = path.basename(filePath); + const extension = path.extname(filePath); + const destinationFileName = path.basename(filePath, extension) + '_' + Date.now() + extension; const message = this.createEventMessage(ViewProviderEvent.onRokuAppOverlayAdded, { id: uuid(), name: name, - sourcePath: file.path, + sourcePath: filePath, destinationFileName: destinationFileName });