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

Updated PSLIB_InvalidPattern0 to be more readable #876

Merged
merged 3 commits into from Nov 1, 2022

Conversation

abatishchev
Copy link
Contributor

@abatishchev abatishchev commented Oct 29, 2022

The only place this localized string used is here:

# Validate pattern does not end with a \.
if ($pattern[$pattern.Length - 1] -eq [System.IO.Path]::DirectorySeparatorChar) {
throw (Get-LocString -Key PSLIB_InvalidPattern0 -ArgumentList $pattern)
}

In real world, the error looks like this

##[error]Invalid pattern: 'C:\__w\1\s\src\Application\pkg\Release\'

Which is too vague to make it possible to troubleshoot without finding and looking into the source code. I ran into this error here: microsoft/azure-pipelines-tasks#17106.

This PR includes:

  1. improving the error message.
  2. using EndsWith() instead of $str[$str,Legth -1] for readability

However, what doesn't include:

  1. I didn't rename the placeholder
  2. nor updated the localizations

Please let me know if I should do the former and what's the process for the latter (I can update the ru-ru string though).

@kirill-ivlev
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@abatishchev
Copy link
Contributor Author

Awesome, thanks everyone! Can someone who has the permissions to complete the PR?

@KonstantinTyukalov KonstantinTyukalov merged commit e05ff6f into microsoft:master Nov 1, 2022
@KonstantinTyukalov
Copy link
Contributor

Done, thanks for the contribution!

@abatishchev abatishchev deleted the patch-1 branch November 1, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants