You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may end up being a request for documentation more than an issue, but I don't know enough about the Globber syntax to know if this is an obvious problem.
What You Are Seeing?
While abusing GetDirectories to get a full directory listing (see this SO question), I ran into cases where certain pattern parameters would case the script execution to fail with an error.
Error: Unknown token
Ignoring that there are better ways to get a directory listing (see the other workaround using System.IO), the error didn't make sense to me given what I could gather from the docs.
What is Expected?
Since the documentation on GetDirectories only has an example with ., **, and * in the pattern, I would expect all other characters to be valid characters to look for a match in the path itself. Again, I don't know if globbing has some pre-defined syntax I should research instead. Maybe a link to some standard on that API page would be a better solution.
What version of Cake are you using?
v0.20.0 (according to pakcages.config)
Are you running on a 32 or 64 bit system?
64-bit
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
For example, given this structure...
"script directory" (contains executing Cake script)
- "sub directory 1"
- "sub sub dir"
- "sub directory #2"
- "sub sub dir"
- "sub direct'ry 3"
- "sub sub dir"
Running these commands to get the "sub sub" directories will fail
Compiling build script...
========================================
GlobIssueRepro
========================================
Executing task: GlobIssueRepro
An error occurred when executing task 'GlobIssueRepro'.
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(GlobTokenKind[] kind)
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.Globber.Match(String pattern, Func`2 predicate) at Cake.Common.IO.GlobbingAliases.GetDirectories(ICakeContext context, String pattern) at Submission#0.GetDirectories(String pattern) at Submission#0.<.ctor>b__0() at Cake.Core.ActionTask.Execute(ICakeContext context) at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context) at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target) at Cake.Scripting.BuildScriptHost.RunTarget(String target) at Submission#0..ctor(Session session, Object& submissionResult) at Submission#0.<Factory>(Session session) at Roslyn.Scripting.CommonScriptEngine.Execute[T](String code, String path, DiagnosticBag diagnostics, Session session, Boolean isInteractive) at Roslyn.Scripting.Session.Execute(String code) 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()
Experimental log
Compiling build script...
========================================
GlobIssueRepro
========================================
Executing task: GlobIssueRepro
An error occurred when executing task 'GlobIssueRepro'.
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(GlobTokenKind[] kind)
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.Globber.Match(String pattern, Func`2 predicate) at Cake.Common.IO.GlobbingAliases.GetDirectories(ICakeContext context, String pattern) at Submission#0.GetDirectories(String pattern) at Submission#0.<.ctor>b__376_0() at Cake.Core.ActionTask.Execute(ICakeContext context) at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context) at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target) at Cake.Scripting.BuildScriptHost.RunTarget(String target) at Submission#0..ctor(Object[] submissionArray, Object& submissionResult) at Submission#0.<Factory>(Object[] submissionArray) at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmission(Func`2 submissionRunner) at Microsoft.CodeAnalysis.Scripting.Script.Run(Object globals) at Microsoft.CodeAnalysis.Scripting.Script.Run(Object globals) at Cake.Scripting.Roslyn.Nightly.DefaultRoslynNightlyScriptSession.Execute(Script script) 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()
The text was updated successfully, but these errors were encountered:
This may end up being a request for documentation more than an issue, but I don't know enough about the Globber syntax to know if this is an obvious problem.
What You Are Seeing?
While abusing
GetDirectories
to get a full directory listing (see this SO question), I ran into cases where certain pattern parameters would case the script execution to fail with an error.Ignoring that there are better ways to get a directory listing (see the other workaround using System.IO), the error didn't make sense to me given what I could gather from the docs.
What is Expected?
Since the documentation on GetDirectories only has an example with
.
,**
, and*
in the pattern, I would expect all other characters to be valid characters to look for a match in the path itself. Again, I don't know if globbing has some pre-defined syntax I should research instead. Maybe a link to some standard on that API page would be a better solution.What version of Cake are you using?
v0.20.0 (according to pakcages.config)
Are you running on a 32 or 64 bit system?
64-bit
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
For example, given this structure...
Running these commands to get the "sub sub" directories will fail
Output Log
Normal log
Experimental log
The text was updated successfully, but these errors were encountered: