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

Globber exception when glob contains % #1245

Closed
Enqueuing opened this issue Sep 21, 2016 · 2 comments
Closed

Globber exception when glob contains % #1245

Enqueuing opened this issue Sep 21, 2016 · 2 comments
Labels
Milestone

Comments

@Enqueuing
Copy link

Enqueuing commented Sep 21, 2016

What You Are Seeing?

When running cake from inside a folder containing a % sign in the name like:
C:\Some%2FDirectory\cake.exe build.cake
The "Installing tools" step fails with a NotSupportedException: "Unknown token"

What is Expected?

GlobTokenizer should treat the % sign as alphanumeric and allow the directory to be globbed.

What version of Cake are you using?

Version 0.15.2+Branch.main.Sha.c2ca4f7ca51c59dc9c47c9830125b4e66cf14e7a

Are you running on a 32 or 64 bit system?

64bit

What environment are you running on? Windows? Linux? Mac?

Windows

Are you running on a CI Server? If so, which one?

Yes, Jenkins. But able to reproduce locally as well.

How Did You Get This To Happen? (Steps to Reproduce)

Try to run cake inside a folder that has a encoded slash in the name: "%2F"

Output Log

F:\JenkinsDevSlave\workspace\CSP\CSP Multibranch pipeline\feature%2Ftestingmodifiedpipeline>powershell -NoLogo -NonInteractive -File setup.ps1 -Verbosity Diagnostic 
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing F:/JenkinsDevSlave/workspace/CSP/CSP Multibranch pipeline/feature%2Ftestingmodifiedpipeline/build.cake...
Processing build script...
Installing tools...
Installing NuGet package OpenCover...
Executing: "F:/JenkinsDevSlave/workspace/CSP/CSP Multibranch pipeline/feature%2Ftestingmodifiedpipeline/tools/nuget.exe" install "OpenCover" -OutputDirectory "F:/JenkinsDevSlave/workspace/CSP/CSP Multibranch pipeline/feature%2Ftestingmodifiedpipeline/tools" -ExcludeVersion -NonInteractive -NoCache
Error: System.NotSupportedException: Unknown token
   at Cake.Core.IO.Globbing.GlobTokenizer.ScanToken()
   at Cake.Core.IO.Globbing.GlobTokenizer.Scan()
   at Cake.Core.IO.Globbing.GlobParserContext.Accept()
   at Cake.Core.IO.Globbing.GlobParserContext.Accept(GlobTokenKind[] kind)
   at Cake.Core.IO.Globbing.GlobParserContext.Accept(GlobTokenKind kind)
   at Cake.Core.IO.Globbing.GlobParser.ParseIdentifier(GlobParserContext context)
   at Cake.Core.IO.Globbing.GlobParser.ParseSubSegment(GlobParserContext context)
   at Cake.Core.IO.Globbing.GlobParser.ParseSegment(GlobParserContext context)
   at Cake.Core.IO.Globbing.GlobParser.Parse(GlobParserContext context)
   at Cake.Core.IO.Globbing.GlobParser.Parse(String pattern, Boolean caseSensitive)
   at Cake.Core.IO.Globber.Match(String pattern, Func`2 predicate)
   at Cake.Core.IO.GlobberExtensions.Match(IGlobber globber, String pattern)
   at Cake.Core.IO.GlobberExtensions.GetFiles(IGlobber globber, String pattern)
   at Cake.NuGet.NuGetContentResolver.GetFiles(DirectoryPath path, PackageReference package)
   at Cake.NuGet.NuGetContentResolver.GetToolFiles(DirectoryPath path, PackageReference package)
   at Cake.NuGet.NuGetContentResolver.GetFiles(DirectoryPath path, PackageReference package, PackageType type)
   at Cake.NuGet.NuGetPackageInstaller.Install(PackageReference package, PackageType type, DirectoryPath path)
   at Cake.Core.Scripting.ScriptProcessor.InstallTools(ScriptAnalyzerResult analyzerResult, DirectoryPath installPath)
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
   at Cake.Commands.BuildCommand.Execute(CakeOptions options)
   at Cake.CakeApplication.Run(CakeOptions options)
   at Cake.Program.Main()
@devlead
Copy link
Member

devlead commented Oct 12, 2016

Fixed by #1246

@devlead devlead closed this as completed Oct 12, 2016
@gep13
Copy link
Member

gep13 commented Oct 13, 2016

@devlead and again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants