Cake Frosting Parent DirectoryPath Fails To Combine with Slash
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have searched issues to ensure it has not already been reported
Cake runner
Cake Frosting
Cake version
1.1.0
Operating system
Linux, Windows
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
A NullReferenceException in the code sample below. However, that’s more the symptom than the cause. The problem appears to be that Cake Frosting is combining Directory("..") + Directory("temp")
into "..temp"
rather than "../temp"
when you capture the context and then use expression bodied properties.
This may seem obscure, but I’m converting a large codebase of DSL Cake into Frosting and am looking for ways to accomplish it with minimal changes.
What is expected?
It should run to completion without an exception
Steps to Reproduce
Run this:
[TaskName("Fail")]
public class FailTask : FrostingTask<BuildContext>
{
private BuildContext? _context;
private DirectoryPath RootDir => _context.Directory("..");
private DirectoryPath TestDir => RootDir + _context.Directory("temp");
public override void Run(BuildContext context)
{
_context = context;
context.GetFiles(TestDir + context.File("*.zip"));
}
}
Output log
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Cake.Core.IO.Globbing.GlobVisitor.VisitParent(ParentDirectoryNode node, GlobVisitorContext context)
at Cake.Core.IO.Globbing.Nodes.ParentDirectoryNode.Accept(GlobVisitor visitor, GlobVisitorContext context)
at Cake.Core.IO.Globbing.GlobVisitor.VisitRelativeRoot(RelativeRootNode node, GlobVisitorContext context)
at Cake.Core.IO.Globbing.Nodes.RelativeRootNode.Accept(GlobVisitor globber, GlobVisitorContext context)
at Cake.Core.IO.Globbing.GlobVisitor.Walk(GlobNode node, GlobberSettings settings)
at Cake.Core.IO.Globber.Match(GlobPattern pattern, GlobberSettings settings)
at Cake.Core.IO.GlobberExtensions.Match(IGlobber globber, GlobPattern pattern)
at Cake.Common.IO.GlobbingAliases.GetFiles(ICakeContext context, GlobPattern pattern)
...
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
v1.3.0 Milestone
Cake Frosting Parent DirectoryPath Fails To Combine with Slash Bug. #3352 by lprichar was closed on Oct 6, 2021. 2 tasks done.
Read more >Cake v1.2.0 released
Cake v1.2.0 released ... Version 1.2.0 of Cake has been released. ... #3352 Cake Frosting Parent DirectoryPath Fails To Combine with Slash.
Read more >Cake v1.3.0 released
NET 6 SDK, as well as build Cake addins and modules targeting the ... #3352 Cake Frosting Parent DirectoryPath Fails To Combine with...
Read more >Cake v1.3.0 released. Version 1.3.0 of Cake has been… | by Cake ...
RollForward; Cake NuGet packages now include a README with general information and ... #3352 Cake Frosting Parent DirectoryPath Fails To Combine with Slash....
Read more >Cake.Frosting 2.0.0-rc0001
Make your feature addition or bug fix. Don't forget the unit tests. Send a pull request. Get in touch. Follow @cakebuildnet. Join the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, of course! That makes sense. Thanks @augustoproiete, looking forward to the next release.
🎉 This issue has been resolved in version v1.3.0 🎉
The release is available on:
Your GitReleaseManager bot 📦🚀