nil4 / dotnet-transform-xdt

Modern .NET tools and library for XDT (Xml Document Transformation)
Apache License 2.0
118 stars 12 forks source link

Create output folder when doesn't exist #44

Closed ivanfranco502 closed 4 years ago

ivanfranco502 commented 4 years ago

Current behaviour

When a user specifies a non-existent output folder, the transformation process failed with the following error:

> dotnet xdt --source "locationOriginalFile" --transform "locationDeltaFile" --output "inexistentLocationOutputFile"
[dotnet-xdt] Transforming 'locationOriginalFile' using 'locationDeltaFile' into 'inexistentLocationOutputFile'
[dotnet-xdt] Unexpected error: System.IO.DirectoryNotFoundException: Could not find a part of the path 'inexistentLocationOutputFile'.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at DotNet.Xdt.Program.Main(String[] args) in d:\a\1\s\dotnet-xdt\Program.cs:line 62

Expected behaviour

The process should create the non-existent folder, so the transformation would succeed.