Skip to content

Commit

Permalink
Disabled percent encoding (#15931)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoly Bolshakov authored Feb 16, 2022
1 parent 1ac2db3 commit d088f37
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"loc.input.label.workingDirectory": "Working Directory",
"loc.input.label.failOnStderr": "Fail on Standard Error",
"loc.input.help.failOnStderr": "If this is true, this task will fail if any errors are written to the StandardError stream.",
"loc.input.label.disablePercentEscaping": "Disable percent escaping",
"loc.input.help.disablePercentEscaping": "By default percent is being escaped in script output - since task always executes script as batch file. Set this to true if you want to disable this behavior.",
"loc.messages.GeneratingScript": "Generating script.",
"loc.messages.JS_ExitCode": "Bash exited with code '%s'.",
"loc.messages.JS_Stderr": "Bash wrote one or more lines to the standard error stream.",
Expand Down
4 changes: 0 additions & 4 deletions Tasks/CmdLineV2/cmdline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ PROCESS {
$input_failOnStderr = Get-VstsInput -Name 'failOnStderr' -AsBool
$input_script = Get-VstsInput -Name 'script'
$input_workingDirectory = Get-VstsInput -Name 'workingDirectory' -Require
$input_disablePercentEscaping = Get-VstsInput -Name 'disablePercentEscaping' -AsBool
Assert-VstsPath -LiteralPath $input_workingDirectory -PathType 'Container'

# Generate the script contents.
Write-Host (Get-VstsLocString -Key 'GeneratingScript')
$contents = "$input_script".Replace("`r`n", "`n").Replace("`n", "`r`n")
if (!$input_disablePercentEscaping) {
$contents = Mask-Percents -Contents $contents
}

if ($contents.IndexOf("`n") -lt 0 -and $contents.IndexOf("##vso[", ([System.StringComparison]::OrdinalIgnoreCase)) -lt 0) {
# Print one-liner scripts.
Expand Down
11 changes: 1 addition & 10 deletions Tasks/CmdLineV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 201,
"Patch": 0
"Patch": 1
},
"releaseNotes": "Script task consistency. Added support for multiple lines.",
"showEnvironmentVariables": true,
Expand Down Expand Up @@ -59,15 +59,6 @@
"required": false,
"helpMarkDown": "If this is true, this task will fail if any errors are written to the StandardError stream.",
"groupName": "advanced"
},
{
"name": "disablePercentEscaping",
"type": "boolean",
"label": "Disable percent escaping",
"defaultValue": "false",
"required": false,
"helpMarkDown": "By default percent is being escaped in script output - since task always executes script as batch file. Set this to true if you want to disable this behavior.",
"groupName": "advanced"
}
],
"instanceNameFormat": "Command Line Script",
Expand Down
11 changes: 1 addition & 10 deletions Tasks/CmdLineV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 201,
"Patch": 0
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"showEnvironmentVariables": true,
Expand Down Expand Up @@ -59,15 +59,6 @@
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.failOnStderr",
"groupName": "advanced"
},
{
"name": "disablePercentEscaping",
"type": "boolean",
"label": "ms-resource:loc.input.label.disablePercentEscaping",
"defaultValue": "false",
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.disablePercentEscaping",
"groupName": "advanced"
}
],
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down

0 comments on commit d088f37

Please sign in to comment.