diff --git a/src/views/ifsBrowser.ts b/src/views/ifsBrowser.ts index 81e62d190..067534839 100644 --- a/src/views/ifsBrowser.ts +++ b/src/views/ifsBrowser.ts @@ -748,7 +748,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) { const remoteFilepath = path.join(ibmi.getLastDownloadLocation(), path.basename(node.path)); downloadLocation = (await vscode.window.showSaveDialog({ defaultUri: vscode.Uri.file(remoteFilepath), - filters: { 'Streamfile': [extname(node.path) || '*'] } + filters: { 'Streamfile': [extname(node.path).substring(1) || '*'] } }))?.path; } @@ -760,7 +760,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) { for (const item of items) { const targetPath = item.path; task.report({ message: targetPath, increment }); - if (saveIntoDirectory) { + if (saveIntoDirectory) { const target = path.join(Tools.fixWindowsPath(downloadLocation!), path.basename(targetPath)); if (item.file.type === "directory") { let proceed = !existsSync(target); @@ -782,7 +782,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) { } } } - else{ + else { await ibmi.downloadFile(downloadLocation!, targetPath); } } @@ -871,6 +871,6 @@ async function showOpenDialog() { /** * Filters the content of an IFSItem array to keep only items whose parent are not in the array */ -function reduceIFSPath(item: IFSItem, index: number, array: IFSItem[]) { - return !array.filter(i => i.file.type === "directory" && i !== item).some(folder => item.file.path.startsWith(folder.file.path)); +function reduceIFSPath(item: IFSItem, index: number, array: IFSItem[]) { + return !array.filter(i => i.file.type === "directory" && i !== item).some(folder => item.file.path.startsWith(folder.file.path)); } \ No newline at end of file