Skip to content

Commit d12b218

Browse files
authored
Merge pull request #1916 from codefori/fix/ifsSingleDownloadFilename
Fixed file extension when downloading a single IFS file
2 parents 24ee3fa + b999eeb commit d12b218

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/views/ifsBrowser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) {
748748
const remoteFilepath = path.join(ibmi.getLastDownloadLocation(), path.basename(node.path));
749749
downloadLocation = (await vscode.window.showSaveDialog({
750750
defaultUri: vscode.Uri.file(remoteFilepath),
751-
filters: { 'Streamfile': [extname(node.path) || '*'] }
751+
filters: { 'Streamfile': [extname(node.path).substring(1) || '*'] }
752752
}))?.path;
753753
}
754754

@@ -760,7 +760,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) {
760760
for (const item of items) {
761761
const targetPath = item.path;
762762
task.report({ message: targetPath, increment });
763-
if (saveIntoDirectory) {
763+
if (saveIntoDirectory) {
764764
const target = path.join(Tools.fixWindowsPath(downloadLocation!), path.basename(targetPath));
765765
if (item.file.type === "directory") {
766766
let proceed = !existsSync(target);
@@ -782,7 +782,7 @@ export function initializeIFSBrowser(context: vscode.ExtensionContext) {
782782
}
783783
}
784784
}
785-
else{
785+
else {
786786
await ibmi.downloadFile(downloadLocation!, targetPath);
787787
}
788788
}
@@ -871,6 +871,6 @@ async function showOpenDialog() {
871871
/**
872872
* Filters the content of an IFSItem array to keep only items whose parent are not in the array
873873
*/
874-
function reduceIFSPath(item: IFSItem, index: number, array: IFSItem[]) {
875-
return !array.filter(i => i.file.type === "directory" && i !== item).some(folder => item.file.path.startsWith(folder.file.path));
874+
function reduceIFSPath(item: IFSItem, index: number, array: IFSItem[]) {
875+
return !array.filter(i => i.file.type === "directory" && i !== item).some(folder => item.file.path.startsWith(folder.file.path));
876876
}

0 commit comments

Comments
 (0)