From f372c090a5bcbdde2c78542e2c787aec79c6f39b Mon Sep 17 00:00:00 2001 From: EzzhevNikita Date: Tue, 22 Sep 2020 13:45:52 +0300 Subject: [PATCH] Change override to overwrite in names --- .../resources.resjson/en-US/resources.resjson | 4 ++-- Tasks/ExtractFilesV1/Tests/L0.ts | 12 ++++++------ Tasks/ExtractFilesV1/Tests/L0Extract.ts | 2 +- Tasks/ExtractFilesV1/extractfilestask.ts | 8 ++++---- Tasks/ExtractFilesV1/task.json | 6 +++--- Tasks/ExtractFilesV1/task.loc.json | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Tasks/ExtractFilesV1/Strings/resources.resjson/en-US/resources.resjson b/Tasks/ExtractFilesV1/Strings/resources.resjson/en-US/resources.resjson index 348ab7539621..5b96e3e585cc 100644 --- a/Tasks/ExtractFilesV1/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/ExtractFilesV1/Strings/resources.resjson/en-US/resources.resjson @@ -9,8 +9,8 @@ "loc.input.help.destinationFolder": "Destination folder into which archive files should be extracted. Use [variables](https://go.microsoft.com/fwlink/?LinkID=550988) if files are not in the repo. Example: $(agent.builddirectory)", "loc.input.label.cleanDestinationFolder": "Clean destination folder before extracting", "loc.input.help.cleanDestinationFolder": "Select this option to clean the destination directory before archive contents are extracted into it.", - "loc.input.label.overrideExistingFiles": "Override existing files", - "loc.input.help.overrideExistingFiles": "Select this option to override any existing files in the destination directory.", + "loc.input.label.overwriteExistingFiles": "Overwrite existing files", + "loc.input.help.overwriteExistingFiles": "Select this option to overwrite existing files in the destination directory.", "loc.messages.ExtractDirFailedinFindFiles": "Specified archive: %s can not be extracted because it is a directory.", "loc.messages.ExtractNotFileFailed": "Specified archive: %s can not be extracted because it is not a file.", "loc.messages.ExtractNotAccessibleFile": "Specified archive: %s can not be extracted because it can not be accessed: %s", diff --git a/Tasks/ExtractFilesV1/Tests/L0.ts b/Tasks/ExtractFilesV1/Tests/L0.ts index 8bb54ff83d10..04c028e7e45f 100644 --- a/Tasks/ExtractFilesV1/Tests/L0.ts +++ b/Tasks/ExtractFilesV1/Tests/L0.ts @@ -21,7 +21,7 @@ describe('ExtractFile Suite', function () { it('Successfully extracts a single zip', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'zip1.zip'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; delete process.env['cleanDestinationFolder']; let tp: string = path.join(__dirname, 'L0Extract.js'); @@ -37,7 +37,7 @@ describe('ExtractFile Suite', function () { it('Successfully extracts multiple zips', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'zip1.zip\nzip2.zip'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; delete process.env['cleanDestinationFolder']; let tp: string = path.join(__dirname, 'L0Extract.js'); @@ -54,7 +54,7 @@ describe('ExtractFile Suite', function () { it('Successfully extracts a tar', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'tar.tar'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; delete process.env['cleanDestinationFolder']; let tp: string = path.join(__dirname, 'L0Extract.js'); @@ -70,7 +70,7 @@ describe('ExtractFile Suite', function () { it('Successfully cleans destination', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'zip1.zip'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; process.env['cleanDestinationFolder'] = 'true'; let tp: string = path.join(__dirname, 'L0Extract.js'); @@ -87,7 +87,7 @@ describe('ExtractFile Suite', function () { it('Successfully overwrites files from zip in output directory', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'zip1.zip'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; delete process.env['cleanDestinationFolder']; let tp: string = path.join(__dirname, 'L0Extract.js'); @@ -105,7 +105,7 @@ describe('ExtractFile Suite', function () { it('Successfully overwrites files from tar in output directory', (done: MochaDone) => { this.timeout(5000); process.env['archiveFilePatterns'] = 'tar.tar'; - process.env['overrideExistingFiles'] = 'true'; + process.env['overwriteExistingFiles'] = 'true'; delete process.env['cleanDestinationFolder']; let tp: string = path.join(__dirname, 'L0Extract.js'); diff --git a/Tasks/ExtractFilesV1/Tests/L0Extract.ts b/Tasks/ExtractFilesV1/Tests/L0Extract.ts index 2b10022cad57..258f5f5bc896 100644 --- a/Tasks/ExtractFilesV1/Tests/L0Extract.ts +++ b/Tasks/ExtractFilesV1/Tests/L0Extract.ts @@ -12,7 +12,7 @@ process.env['SYSTEM_DEFAULTWORKINGDIRECTORY'] = __dirname; tmr.setInput('archiveFilePatterns', process.env['archiveFilePatterns']); tmr.setInput('destinationFolder', __dirname); tmr.setInput('cleanDestinationFolder', process.env['cleanDestinationFolder']); -tmr.setInput('overrideExistingFiles', process.env['overrideExistingFiles']); +tmr.setInput('overwriteExistingFiles', process.env['overwriteExistingFiles']); const osType = os.type(); const isWindows = !!osType.match(/^Win/); diff --git a/Tasks/ExtractFilesV1/extractfilestask.ts b/Tasks/ExtractFilesV1/extractfilestask.ts index 8e4c60263516..7a0099df6f66 100644 --- a/Tasks/ExtractFilesV1/extractfilestask.ts +++ b/Tasks/ExtractFilesV1/extractfilestask.ts @@ -8,7 +8,7 @@ import os = require('os'); var archiveFilePatterns: string[] = tl.getDelimitedInput('archiveFilePatterns', '\n', true); var destinationFolder: string = path.normalize(tl.getPathInput('destinationFolder', true, false).trim()); var cleanDestinationFolder: boolean = tl.getBoolInput('cleanDestinationFolder', false); -var overrideExistingFiles: boolean = tl.getBoolInput('overrideExistingFiles', false); +var overwriteExistingFiles: boolean = tl.getBoolInput('overwriteExistingFiles', false); var repoRoot: string = tl.getVariable('System.DefaultWorkingDirectory'); tl.debug('repoRoot: ' + repoRoot); @@ -192,7 +192,7 @@ function unzipExtract(file, destinationFolder) { } var unzip = tl.tool(xpUnzipLocation); unzip.arg(file); - if (overrideExistingFiles) { + if (overwriteExistingFiles) { unzip.arg('-o'); } unzip.arg('-d'); @@ -203,7 +203,7 @@ function unzipExtract(file, destinationFolder) { function sevenZipExtract(file, destinationFolder) { console.log(tl.loc('SevenZipExtractFile', file)); var sevenZip = tl.tool(getSevenZipLocation()); - if (overrideExistingFiles) { + if (overwriteExistingFiles) { sevenZip.arg('-aoa'); } sevenZip.arg('x'); @@ -219,7 +219,7 @@ function tarExtract(file, destinationFolder) { } var tar = tl.tool(xpTarLocation); tar.arg('-xvf'); // tar will correctly handle compression types outlined in isTar() - if (overrideExistingFiles) { + if (overwriteExistingFiles) { tar.arg('-k'); } tar.arg(file); diff --git a/Tasks/ExtractFilesV1/task.json b/Tasks/ExtractFilesV1/task.json index f6807614f5da..823959c1b8fe 100644 --- a/Tasks/ExtractFilesV1/task.json +++ b/Tasks/ExtractFilesV1/task.json @@ -52,12 +52,12 @@ "helpMarkDown": "Select this option to clean the destination directory before archive contents are extracted into it." }, { - "name": "overrideExistingFiles", + "name": "overwriteExistingFiles", "type": "boolean", - "label": "Override existing files", + "label": "Overwrite existing files", "required": true, "defaultValue": "true", - "helpMarkDown": "Select this option to override any existing files in the destination directory." + "helpMarkDown": "Select this option to overwrite existing files in the destination directory." } ], "execution": { diff --git a/Tasks/ExtractFilesV1/task.loc.json b/Tasks/ExtractFilesV1/task.loc.json index 1afe6022cb99..23771c46777e 100644 --- a/Tasks/ExtractFilesV1/task.loc.json +++ b/Tasks/ExtractFilesV1/task.loc.json @@ -52,12 +52,12 @@ "helpMarkDown": "ms-resource:loc.input.help.cleanDestinationFolder" }, { - "name": "overrideExistingFiles", + "name": "overwriteExistingFiles", "type": "boolean", - "label": "ms-resource:loc.input.label.overrideExistingFiles", + "label": "ms-resource:loc.input.label.overwriteExistingFiles", "required": true, "defaultValue": "true", - "helpMarkDown": "ms-resource:loc.input.help.overrideExistingFiles" + "helpMarkDown": "ms-resource:loc.input.help.overwriteExistingFiles" } ], "execution": {