Skip to content

Commit

Permalink
Merge pull request #1888 from codefori/feature/mulitMembersDownoad
Browse files Browse the repository at this point in the history
Allow multi members download
  • Loading branch information
sebjulliand authored Mar 1, 2024
2 parents 14333b1 + 43a0053 commit 48e5f6e
Show file tree
Hide file tree
Showing 8 changed files with 433 additions and 249 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@
},
{
"command": "code-for-ibmi.downloadMemberAsFile",
"when": "view == objectBrowser && viewItem =~ /^member.*$/",
"when": "view == objectBrowser && viewItem =~ /^(member|SPF).*$/",
"group": "3_memberTransfer@1"
},
{
Expand Down
21 changes: 21 additions & 0 deletions src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,4 +1171,25 @@ export default class IBMi {
return file.fsPath;
}
}

/**
* Creates a temporary directory and pass it on to a `process` function.
* The directory is guaranteed to be empty when created and deleted after the `process` is done.
* @param process the process that will run on the empty directory
*/
async withTempDirectory(process: (directory: string) => Promise<void>) {
const tempDirectory = `${this.config?.tempDir || '/tmp'}/code4itemp${Tools.makeid(20)}`;
const prepareDirectory = await this.sendCommand({ command: `rm -rf ${tempDirectory} && mkdir -p ${tempDirectory}` });
if (prepareDirectory.code === 0) {
try {
await process(tempDirectory);
}
finally {
await this.sendCommand({ command: `rm -rf ${tempDirectory}` });
}
}
else {
throw new Error(`Failed to create temporary directory ${tempDirectory}: ${prepareDirectory.stderr}`);
}
}
}
14 changes: 11 additions & 3 deletions src/locale/ids/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export const da: Locale = {
'type': 'Type',
'attribute': 'Attribut',
'created_by': 'Oprettet af',
'overwrite': 'Erstat',
'overwrite_all': 'Erstat alle',
'ask.overwrite':'{0} eksisterer allerede.\nVil du erstatte?',
'skip':'Spring over',
'skip_all':'Spring alle over',
// Sandbox:
'sandbox.input.user.title': `Bruger for server`,
'sandbox.input.user.prompt': `Indtast brugernavn for {0}`,
Expand Down Expand Up @@ -116,7 +121,6 @@ export const da: Locale = {
'ifsBrowser.searchIFS.title2': `Søg i {0}`,
'ifsBrowser.searchIFS.noGrep': `'grep' skal være installeret på systemet for IFS søgning.`,
'ifsBrowser.downloadStreamfile.downloading':'Henter',
'ifsBrowser.downloadStreamfile.overwrite':'{0} eksisterer allerede.\nVil du erstatte?',
'ifsBrowser.downloadStreamfile.complete': `Hentning gennemført.`,
'ifsBrowser.downloadStreamfile.errorMessage': `Fejl under hentning: {0}`,
'ifsBrowser.getChildren.errorMessage': `Fejl ved læsning af objekter.`,
Expand Down Expand Up @@ -166,8 +170,12 @@ export const da: Locale = {
'objectBrowser.renameMember.invalid.input': `Nyt member navn skal være forskelligt fra det nuværende navn`,
'objectBrowser.uploadAndReplaceMemberAsFile.infoMessage': `Fil blev sendt til member.`,
'objectBrowser.uploadAndReplaceMemberAsFile.errorMessage': `Fejl ved afsendelse af fil! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Member blev hentet.`,
'objectBrowser.downloadMemberContent.errorMessage': `Fejl ved hentning af member! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Members download complete.`,
'objectBrowser.downloadMemberContent.errorMessage': `Error downloading member(s)! {0}`,
'objectBrowser.downloadMemberContent.cancel': `Members download cancelled.`,
'objectBrowser.downloadMemberContent.download.progress':'Downloading {0} members',
'objectBrowser.downloadMemberContent.download.cpytostmf':'copying to streamfiles',
'objectBrowser.downloadMemberContent.download.streamfiles':'getting streamfiles',
'objectBrowser.searchSourceFile.prompt': `Indtast LIB/SPF/member.ext til søgning (member.ext er valgfrit og kan indeholde mønstertegn)`,
'objectBrowser.searchSourceFile.title': `Søg source fil`,
'objectBrowser.searchSourceFile.invalidForm': `Venligst indtast værdi på formatet LIB/SPF/member.ext`,
Expand Down
16 changes: 12 additions & 4 deletions src/locale/ids/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export const en: Locale = {
'type': 'Type',
'attribute': 'Attribute',
'created_by': 'Created by',
'overwrite': 'Overwrite',
'overwrite_all': 'Overwrite all',
'ask.overwrite':'{0} already exists.\nDo you want to replace it?',
'skip':'Skip',
'skip_all':'Skip all',
// Sandbox:
'sandbox.input.user.title': `User for server`,
'sandbox.input.user.prompt': `Enter username for {0}`,
Expand Down Expand Up @@ -115,8 +120,7 @@ export const en: Locale = {
'ifsBrowser.searchIFS.placeholder': `Enter search term or select one of the previous search terms.`,
'ifsBrowser.searchIFS.placeholder2': `Enter search term.`,
'ifsBrowser.searchIFS.noGrep': `grep must be installed on the remote system for the IFS search.`,
'ifsBrowser.downloadStreamfile.downloading':'Downloading',
'ifsBrowser.downloadStreamfile.overwrite':'{0} already exists.\nDo you want to replace it?',
'ifsBrowser.downloadStreamfile.downloading':'Downloading',
'ifsBrowser.downloadStreamfile.complete': `Download complete`,
'ifsBrowser.downloadStreamfile.errorMessage': `Error downloading file(s): {0}`,
'ifsBrowser.getChildren.errorMessage': `Error loading objects.`,
Expand Down Expand Up @@ -166,8 +170,12 @@ export const en: Locale = {
'objectBrowser.renameMember.invalid.input': `New member name must be different from it's current name`,
'objectBrowser.uploadAndReplaceMemberAsFile.infoMessage': `Member was uploaded.`,
'objectBrowser.uploadAndReplaceMemberAsFile.errorMessage': `Error uploading content to member! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Member was downloaded.`,
'objectBrowser.downloadMemberContent.errorMessage': `Error downloading member! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Members download complete.`,
'objectBrowser.downloadMemberContent.errorMessage': `Error downloading member(s)! {0}`,
'objectBrowser.downloadMemberContent.cancel': `Members download cancelled.`,
'objectBrowser.downloadMemberContent.download.progress':'Downloading {0} members',
'objectBrowser.downloadMemberContent.download.cpytostmf':'copying to streamfiles',
'objectBrowser.downloadMemberContent.download.streamfiles':'getting streamfiles',
'objectBrowser.searchSourceFile.prompt': `Enter LIB/SPF/member.ext to search (member.ext is optional and can contain wildcards)`,
'objectBrowser.searchSourceFile.title': `Search source file`,
'objectBrowser.searchSourceFile.invalidForm': `Please enter value in form LIB/SPF/member.ext`,
Expand Down
14 changes: 11 additions & 3 deletions src/locale/ids/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export const fr: Locale = {
'type': 'Type',
'attribute': 'Attribut',
'created_by': 'Créé par',
'overwrite': 'Écraser',
'overwrite_all': 'Écraser tout',
'ask.overwrite':'{0} existe déjà.\nVoulez-vous le remplacer?',
'skip':'Ignorer',
'skip_all':'Ignorer tout',
// Sandbox:
'sandbox.input.user.title': `Nom d'utilisateur`,
'sandbox.input.user.prompt': `Entrez le nom d'utilisateur pour {0}`,
Expand Down Expand Up @@ -116,7 +121,6 @@ export const fr: Locale = {
'ifsBrowser.searchIFS.title2': `Chercher dans {0}.`,
'ifsBrowser.searchIFS.noGrep': `grep doit être installé sur le système distant pour la recherche sur l'IFS.`,
'ifsBrowser.downloadStreamfile.downloading':'Téléchargement',
'ifsBrowser.downloadStreamfile.overwrite':'{0} existe déjà.\nVoulez-vous le remplacer?',
'ifsBrowser.downloadStreamfile.complete': `Téléchargement terminé`,
'ifsBrowser.downloadStreamfile.errorMessage': `Erreur lors du téléchargement: {0}`,
'ifsBrowser.getChildren.errorMessage': `Erreur lors du chargement des objets.`,
Expand Down Expand Up @@ -166,8 +170,12 @@ export const fr: Locale = {
'objectBrowser.renameMember.invalid.input': `Le nouveau nom du membre doit être différent de l'ancien`,
'objectBrowser.uploadAndReplaceMemberAsFile.infoMessage': `Le membre a été uploadé.`,
'objectBrowser.uploadAndReplaceMemberAsFile.errorMessage': `Erreur lors de l'upload du contenu du membre! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Le membre a été téléchargé.`,
'objectBrowser.downloadMemberContent.errorMessage': `Erreur lors du téléchargement du membre! {0}`,
'objectBrowser.downloadMemberContent.infoMessage': `Téléchargement des membres terminé.`,
'objectBrowser.downloadMemberContent.errorMessage': `Erreur lors du téléchargement des membres! {0}`,
'objectBrowser.downloadMemberContent.cancel': `Téléchargement des membres annulé.`,
'objectBrowser.downloadMemberContent.download.progress':'Téléchargement de {0} membres',
'objectBrowser.downloadMemberContent.download.cpytostmf':'copie des membres en streamfiles',
'objectBrowser.downloadMemberContent.download.streamfiles':'récupération des streamfiles',
'objectBrowser.searchSourceFile.prompt': `Entrez LIB/SPF/membre.ext pour chercher (membre.ext est optionnel et peut contenir des caractères génériques)`,
'objectBrowser.searchSourceFile.title': `Rechercher dans un fichier source`,
'objectBrowser.searchSourceFile.invalidForm': `Entrez une valeur de la forme LIB/SPF/membre.ext`,
Expand Down
Loading

0 comments on commit 48e5f6e

Please sign in to comment.