Skip to content

Commit 467c78d

Browse files
authored
Merge pull request #2819 from chrjorgensen/fix/copy-file-with-blanks
Omit escaping paths when copying IFS objects
2 parents 32cb983 + 80c7d6c commit 467c78d

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/api/IBMiContent.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,21 @@ export default class IBMiContent {
138138

139139
/**
140140
* Download the content of a source member
141-
*
142-
* @param library
143-
* @param sourceFile
144-
* @param member
145-
* @param localPath
141+
*
142+
* @param library
143+
* @param sourceFile
144+
* @param member
145+
* @param localPath
146146
*/
147147
async downloadMemberContent(library: string, sourceFile: string, member: string, localPath?: string): Promise<string>;
148148
/**
149149
* @deprecated Will be removed in `v3.0.0`; use {@link IBMiContent.downloadMemberContent()} without the `asp` parameter instead.
150-
*
151-
* @param asp
152-
* @param library
153-
* @param sourceFile
154-
* @param member
155-
* @param localPath
150+
*
151+
* @param asp
152+
* @param library
153+
* @param sourceFile
154+
* @param member
155+
* @param localPath
156156
*/
157157
async downloadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string, localPath?: string): Promise<string>;
158158
async downloadMemberContent(aspOrLibrary: string | undefined, libraryOrSourceFile: string, sourceFileOrMember: string, memberOrLocalPath?: string, localPath?: string): Promise<string> {
@@ -221,21 +221,21 @@ export default class IBMiContent {
221221

222222
/**
223223
* Upload to a member
224-
*
225-
* @param library
226-
* @param sourceFile
227-
* @param member
228-
* @param content
224+
*
225+
* @param library
226+
* @param sourceFile
227+
* @param member
228+
* @param content
229229
*/
230230
async uploadMemberContent(library: string, sourceFile: string, member: string, content: string | Uint8Array): Promise<boolean>;
231231

232232
/**
233233
* @deprecated Will be removed in `v3.0.0`; use {@link IBMiContent.uploadMemberContent()} without the `asp` parameter instead.
234-
* @param asp
235-
* @param library
236-
* @param sourceFile
237-
* @param member
238-
* @param content
234+
* @param asp
235+
* @param library
236+
* @param sourceFile
237+
* @param member
238+
* @param content
239239
*/
240240
async uploadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string, content: string | Uint8Array): Promise<boolean>;
241241
async uploadMemberContent(aspOrLibrary: string | undefined, libraryOrFile: string, sourceFileOrMember: string, memberOrContent: string | Uint8Array, content?: string | Uint8Array): Promise<boolean> {
@@ -1153,9 +1153,8 @@ export default class IBMiContent {
11531153
*/
11541154
async copy(paths: string | string[], toPath: string): Promise<CommandResult> {
11551155
paths = Array.isArray(paths) ? paths : [paths];
1156-
toPath = Tools.escapePath(toPath);
1157-
const toPathIsDir = await this.isDirectory(toPath);
1158-
for (const path of paths.map(path => Tools.escapePath(path))) {
1156+
const toPathIsDir = await this.isDirectory(Tools.escapePath(toPath));
1157+
for (const path of paths) {
11591158
const result = await this.ibmi.runCommand({ command: `COPY OBJ('${path}') ${toPathIsDir ? 'TODIR(' : 'TOOBJ(' }'${toPath}') SUBTREE(*ALL) REPLACE(*YES)`, environment: "ile" });
11601159
if (result.code !== 0) {
11611160
return result;

0 commit comments

Comments
 (0)