Skip to content

Commit

Permalink
(GH-8) Make sure directory of output file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Jun 22, 2018
1 parent 56285a2 commit 74ed7cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Cake.Markdownlint/NodeJs/MarkdownlintNodeJsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using Cake.Core.Diagnostics;
using Core;
using Core.IO;
Expand Down Expand Up @@ -43,6 +44,12 @@ public void RunMarkdownlint(MarkdownlintNodeJsRunnerSettings settings)
var args = new ProcessArgumentBuilder();
settings.Evaluate(args);

// Make sure directory of output file exists as otherwise markdownlint will silently fail.
if (settings.OutputFile != null)
{
Directory.CreateDirectory(settings.OutputFile.GetDirectory().FullPath);
}

var processSettings = new ProcessSettings
{
Arguments = args.Render(),
Expand Down

0 comments on commit 74ed7cc

Please sign in to comment.