Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled percent encoding #15931

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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