Skip to content

Commit

Permalink
Fix path issue on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Feb 29, 2024
1 parent b2990d9 commit 1fd50f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/viewProviders/RokuAppOverlaysViewViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 1fd50f9

Please sign in to comment.