Skip to content

Resolve the path containing wildcards in filePath task input#429

Merged
TingluoHuang merged 1 commit into
masterfrom
users/kasubram/rmwildcardfix
Jul 21, 2016
Merged

Resolve the path containing wildcards in filePath task input#429
TingluoHuang merged 1 commit into
masterfrom
users/kasubram/rmwildcardfix

Conversation

@kasubram
Copy link
Copy Markdown

No description provided.

Trace.Error(ex);
return path;
}
}
Copy link
Copy Markdown
Contributor

@TingluoHuang TingluoHuang Jul 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you can combine the two section of try-catch into one, since Path.Combin(foo, bar) will return bar if bar is already rooted.

string artifactRootPath = context.Variables.Release_ArtifactsDirectory ?? string.Empty;
if (!string.IsNullOrEmpty(artifactRootPath) && 
    artifactRootPath.IndexOfAny(Path.GetInvalidPathChars()) < 0 &&
    !string.IsNullOrEmpty(path) && 
    path.IndexOfAny(Path.GetInvalidPathChars()) < 0)
{
    path = Path.Combine(artifactRootPath, path);
    ...
    ...
}

@TingluoHuang TingluoHuang merged commit 0362b88 into master Jul 21, 2016
@TingluoHuang TingluoHuang deleted the users/kasubram/rmwildcardfix branch July 21, 2016 19:12
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.

3 participants