From fe8b33712b93fa2d4d221f80b4ee9a5e43f0b7d2 Mon Sep 17 00:00:00 2001 From: Keuvain Date: Sat, 5 Dec 2015 12:17:14 +0100 Subject: [PATCH 1/7] First draft of the create new post command --- src/Pretzel/Commands/NewpostCommand.cs | 66 ++++++++++++++++++++++++++ src/Pretzel/Pretzel.csproj | 1 + 2 files changed, 67 insertions(+) create mode 100644 src/Pretzel/Commands/NewpostCommand.cs diff --git a/src/Pretzel/Commands/NewpostCommand.cs b/src/Pretzel/Commands/NewpostCommand.cs new file mode 100644 index 000000000..9d892996c --- /dev/null +++ b/src/Pretzel/Commands/NewpostCommand.cs @@ -0,0 +1,66 @@ +using Pretzel.Logic.Commands; +using Pretzel.Logic.Extensibility; +using Pretzel.Logic.Extensions; +using Pretzel.Logic.Templating.Context; +using System; +using System.Linq; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Diagnostics; +using System.IO; +using System.IO.Abstractions; +using Pretzel.Logic.Extensibility.Extensions; + +namespace Pretzel.Commands +{ + [PartCreationPolicy(CreationPolicy.Shared)] + [CommandInfo(CommandName = "newpost")] + public sealed class NewpostCommand : ICommand + { +#pragma warning disable 649 + + [Import] + private IFileSystem fileSystem; + +#pragma warning restore 649 + + public void Execute(IEnumerable arguments) + { + var postPath = fileSystem.Path.Combine(fileSystem.Directory.GetCurrentDirectory(), @"_posts"); + + Tracing.Info("newpost - create a new post"); + + if (arguments.Count() == 0) + { + Tracing.Info("A title must be provided."); + return; + } + + var title = arguments.First(); + var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(title)); + var pageContents = string.Format("---\r\n layout: post \r\n title: {0}\r\n comments: true\r\n---\r\n", title); + + + if (!fileSystem.Directory.Exists(postPath)) + { + Tracing.Info("_posts folder not created."); + return; + } + + if (fileSystem.File.Exists(fileSystem.Path.Combine(postPath, postName))) + { + Tracing.Info(String.Format("The \"{0}\" file already exists", postName)); + return; + } + + fileSystem.File.WriteAllText(fileSystem.Path.Combine(postPath, postName), pageContents); + + Tracing.Info(String.Format("Created the \"{0}\" post ({1})", title, postName)); + } + + public void WriteHelp(TextWriter writer) + { + writer.Write(" Create a new post\r\n"); + } + } +} diff --git a/src/Pretzel/Pretzel.csproj b/src/Pretzel/Pretzel.csproj index 974579d05..47574ea7b 100644 --- a/src/Pretzel/Pretzel.csproj +++ b/src/Pretzel/Pretzel.csproj @@ -132,6 +132,7 @@ + From 77bb4ae618bcc7f7c1036c4aec795f588cd065a6 Mon Sep 17 00:00:00 2001 From: Keuvain Date: Sat, 5 Dec 2015 18:02:47 +0100 Subject: [PATCH 2/7] Changed the command name --- .../{NewpostCommand.cs => SpiceCommand.cs} | 19 ++++++++++--------- src/Pretzel/Pretzel.csproj | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) rename src/Pretzel/Commands/{NewpostCommand.cs => SpiceCommand.cs} (82%) diff --git a/src/Pretzel/Commands/NewpostCommand.cs b/src/Pretzel/Commands/SpiceCommand.cs similarity index 82% rename from src/Pretzel/Commands/NewpostCommand.cs rename to src/Pretzel/Commands/SpiceCommand.cs index 9d892996c..9f042aefa 100644 --- a/src/Pretzel/Commands/NewpostCommand.cs +++ b/src/Pretzel/Commands/SpiceCommand.cs @@ -1,12 +1,9 @@ using Pretzel.Logic.Commands; -using Pretzel.Logic.Extensibility; using Pretzel.Logic.Extensions; -using Pretzel.Logic.Templating.Context; using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel.Composition; -using System.Diagnostics; using System.IO; using System.IO.Abstractions; using Pretzel.Logic.Extensibility.Extensions; @@ -14,21 +11,24 @@ namespace Pretzel.Commands { [PartCreationPolicy(CreationPolicy.Shared)] - [CommandInfo(CommandName = "newpost")] - public sealed class NewpostCommand : ICommand + [CommandInfo(CommandName = "spice")] + public sealed class SpiceCommand : ICommand { #pragma warning disable 649 [Import] private IFileSystem fileSystem; + [Import] + private CommandParameters parameters; + #pragma warning restore 649 public void Execute(IEnumerable arguments) { - var postPath = fileSystem.Path.Combine(fileSystem.Directory.GetCurrentDirectory(), @"_posts"); + Tracing.Info("spice - create a new post"); - Tracing.Info("newpost - create a new post"); + parameters.Parse(arguments); if (arguments.Count() == 0) { @@ -37,13 +37,13 @@ public void Execute(IEnumerable arguments) } var title = arguments.First(); + var postPath = fileSystem.Path.Combine(fileSystem.Directory.GetCurrentDirectory(), @"_posts"); var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(title)); var pageContents = string.Format("---\r\n layout: post \r\n title: {0}\r\n comments: true\r\n---\r\n", title); - if (!fileSystem.Directory.Exists(postPath)) { - Tracing.Info("_posts folder not created."); + Tracing.Info("_posts folder not found."); return; } @@ -61,6 +61,7 @@ public void Execute(IEnumerable arguments) public void WriteHelp(TextWriter writer) { writer.Write(" Create a new post\r\n"); + parameters.WriteOptions(writer, "draft", "-s"); } } } diff --git a/src/Pretzel/Pretzel.csproj b/src/Pretzel/Pretzel.csproj index 47574ea7b..1e5be1a3f 100644 --- a/src/Pretzel/Pretzel.csproj +++ b/src/Pretzel/Pretzel.csproj @@ -132,7 +132,7 @@ - + From b2075be85077dd0b21c677f6486efdd01256f657 Mon Sep 17 00:00:00 2001 From: Keuvain Date: Wed, 9 Dec 2015 20:33:16 +0100 Subject: [PATCH 3/7] New name for the command : Ingredient --- .../Commands/{SpiceCommand.cs => IngredientCommand.cs} | 10 +++++----- src/Pretzel/Pretzel.csproj | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename src/Pretzel/Commands/{SpiceCommand.cs => IngredientCommand.cs} (89%) diff --git a/src/Pretzel/Commands/SpiceCommand.cs b/src/Pretzel/Commands/IngredientCommand.cs similarity index 89% rename from src/Pretzel/Commands/SpiceCommand.cs rename to src/Pretzel/Commands/IngredientCommand.cs index 9f042aefa..3c0e679e5 100644 --- a/src/Pretzel/Commands/SpiceCommand.cs +++ b/src/Pretzel/Commands/IngredientCommand.cs @@ -11,8 +11,8 @@ namespace Pretzel.Commands { [PartCreationPolicy(CreationPolicy.Shared)] - [CommandInfo(CommandName = "spice")] - public sealed class SpiceCommand : ICommand + [CommandInfo(CommandName = "ingredient")] + public sealed class IngredientCommand : ICommand { #pragma warning disable 649 @@ -26,7 +26,7 @@ public sealed class SpiceCommand : ICommand public void Execute(IEnumerable arguments) { - Tracing.Info("spice - create a new post"); + Tracing.Info("ingredient - create a new post"); parameters.Parse(arguments); @@ -61,7 +61,7 @@ public void Execute(IEnumerable arguments) public void WriteHelp(TextWriter writer) { writer.Write(" Create a new post\r\n"); - parameters.WriteOptions(writer, "draft", "-s"); + parameters.WriteOptions(writer, "drafts", "-s"); } } -} +} \ No newline at end of file diff --git a/src/Pretzel/Pretzel.csproj b/src/Pretzel/Pretzel.csproj index 1e5be1a3f..5b4fdb228 100644 --- a/src/Pretzel/Pretzel.csproj +++ b/src/Pretzel/Pretzel.csproj @@ -132,7 +132,7 @@ - + From 4b6590b6bee114589d41bdebdc15e641fa7d8724 Mon Sep 17 00:00:00 2001 From: Keuvain Date: Wed, 9 Dec 2015 21:18:24 +0100 Subject: [PATCH 4/7] Added a new parameter for the post title --- .../Commands/CommandParameters.cs | 9 +++- .../Commands/CommandParameterTests.cs | 41 +++++++++++++++++++ src/Pretzel/Commands/IngredientCommand.cs | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/Pretzel.Logic/Commands/CommandParameters.cs b/src/Pretzel.Logic/Commands/CommandParameters.cs index b02758308..d1c63e631 100644 --- a/src/Pretzel.Logic/Commands/CommandParameters.cs +++ b/src/Pretzel.Logic/Commands/CommandParameters.cs @@ -35,7 +35,8 @@ public CommandParameters([ImportMany] IEnumerable commandL { "nobrowser", "Do not launch a browser", v => LaunchBrowser = false }, { "withproject", "Includes a layout VS Solution, to give intellisense when editing razor layout files", v => WithProject = (v!=null) }, { "wiki", "Creates a wiki instead of a blog (razor template only)", v => Wiki = (v!=null) }, - { "cleantarget", "Delete the target directory (_site by default)", v => CleanTarget = true } + { "cleantarget", "Delete the target directory (_site by default)", v => CleanTarget = true }, + { "n|newposttitle=", "The title of the new post (\"New post\" by default)", v => NewPostTitle = v } }; // Allow extensions to register command line args @@ -66,6 +67,8 @@ public CommandParameters([ImportMany] IEnumerable commandL public string DestinationPath { get; private set; } + public string NewPostTitle { get; internal set; } + private decimal port; public decimal Port @@ -91,6 +94,10 @@ public void Parse(IEnumerable arguments) { DestinationPath = fileSystem.Path.Combine(Path, DestinationPath); } + if (string.IsNullOrEmpty(NewPostTitle)) + { + NewPostTitle = "New post"; + } } public void DetectFromDirectory(IDictionary engines, SiteContext context) diff --git a/src/Pretzel.Tests/Commands/CommandParameterTests.cs b/src/Pretzel.Tests/Commands/CommandParameterTests.cs index 97513697f..bb39a4b0e 100644 --- a/src/Pretzel.Tests/Commands/CommandParameterTests.cs +++ b/src/Pretzel.Tests/Commands/CommandParameterTests.cs @@ -22,6 +22,7 @@ public class CommandParameterTests private const string ExpectedPort = "8000"; private const decimal ExpectedPortDecimal = 8000; private const string ExpectedDestinationPath = @"D:\Code\Generated"; + private const string ExpectedNewPostTitle = @"Post title"; private readonly IFileSystem FileSystem = new MockFileSystem(); @@ -236,6 +237,38 @@ public void LaunchBrowser_WhenNotSpecifyingCleanTarget_IsFalse() Assert.False(subject.CleanTarget); } + [Fact] + public void Parse_WhenSpecifyingNewPostTitleUsingShortParameter_MapsToPath() + { + var args = new List { "--n", ExpectedNewPostTitle }; + subject.Parse(args); + Assert.Equal(ExpectedNewPostTitle, subject.NewPostTitle); + } + + [Fact] + public void Parse_WhenSpecifyingNewPostTitleUsingFullParameter_MapsToPath() + { + var args = new List { "--newposttitle", ExpectedNewPostTitle }; + subject.Parse(args); + Assert.Equal(ExpectedNewPostTitle, subject.NewPostTitle); + } + + [Fact] + public void Parse_WhenSpecifyingNewPostTitleUsingShortParameterSingleDash_MapsToPath() + { + var args = new List { "-n", ExpectedNewPostTitle }; + subject.Parse(args); + Assert.Equal(ExpectedNewPostTitle, subject.NewPostTitle); + } + + [Fact] + public void Parse_WhenSpecifyingNewPostTitleUsingFullParameterSingleDash_MapsToPath() + { + var args = new List { "-newposttitle", ExpectedNewPostTitle }; + subject.Parse(args); + Assert.Equal(ExpectedNewPostTitle, subject.NewPostTitle); + } + [Fact] public void CommandParameters_WhenSpecifyingAllParameters_ResultIsCorrect() { @@ -410,5 +443,13 @@ public void Parse_WhenNoParametersSet_MapsDestinationPathTo_siteInCurrentDirecto subject.Parse(args); Assert.Equal(FileSystem.Path.Combine(subject.Path, "_site"), subject.DestinationPath); } + + [Fact] + public void Parse_WhenNoParametersSet_MapsNewPostTileToNewPost() + { + var args = new List(); + subject.Parse(args); + Assert.Equal("New post", subject.NewPostTitle); + } } } diff --git a/src/Pretzel/Commands/IngredientCommand.cs b/src/Pretzel/Commands/IngredientCommand.cs index 3c0e679e5..a3405e6b5 100644 --- a/src/Pretzel/Commands/IngredientCommand.cs +++ b/src/Pretzel/Commands/IngredientCommand.cs @@ -61,7 +61,7 @@ public void Execute(IEnumerable arguments) public void WriteHelp(TextWriter writer) { writer.Write(" Create a new post\r\n"); - parameters.WriteOptions(writer, "drafts", "-s"); + parameters.WriteOptions(writer, "newposttitle", "drafts", "-s"); } } } \ No newline at end of file From 77fe8502eda9b6745dfb638e75376274f2925488 Mon Sep 17 00:00:00 2001 From: Keuvain Date: Thu, 10 Dec 2015 21:10:20 +0100 Subject: [PATCH 5/7] Moved the Ingredient logic in the Pretzel.Logic project --- src/Pretzel.Logic/Pretzel.Logic.csproj | 1 + src/Pretzel.Logic/Recipe/Ingredient.cs | 50 +++++++++++++++++++++++ src/Pretzel/Commands/IngredientCommand.cs | 32 ++------------- 3 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 src/Pretzel.Logic/Recipe/Ingredient.cs diff --git a/src/Pretzel.Logic/Pretzel.Logic.csproj b/src/Pretzel.Logic/Pretzel.Logic.csproj index d335c9430..fb8f63f96 100644 --- a/src/Pretzel.Logic/Pretzel.Logic.csproj +++ b/src/Pretzel.Logic/Pretzel.Logic.csproj @@ -168,6 +168,7 @@ True Resources.resx + diff --git a/src/Pretzel.Logic/Recipe/Ingredient.cs b/src/Pretzel.Logic/Recipe/Ingredient.cs new file mode 100644 index 000000000..01b62df75 --- /dev/null +++ b/src/Pretzel.Logic/Recipe/Ingredient.cs @@ -0,0 +1,50 @@ +using System; +using System.IO.Abstractions; +using Pretzel.Logic.Extensibility.Extensions; +using Pretzel.Logic.Extensions; + +namespace Pretzel.Logic.Recipe +{ + public class Ingredient + { + private readonly string directory; + + private readonly IFileSystem fileSystem; + + private readonly string title; + + private readonly bool withDrafts; + + public Ingredient(IFileSystem fileSystem, string title, string directory, bool withDrafts) + { + this.fileSystem = fileSystem; + this.title = title; + this.directory = directory; + this.withDrafts = withDrafts; + } + + public void Create() + { + var postPath = fileSystem.Path.Combine(directory, !this.withDrafts ? @"_posts" : @"_drafts"); + + var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(title)); + var pageContents = string.Format("---\r\n layout: post \r\n title: {0}\r\n comments: true\r\n---\r\n", title); + + if (!fileSystem.Directory.Exists(postPath)) + { + Tracing.Info(string.Format("{0} folder not found.", postPath)); + return; + } + + if (fileSystem.File.Exists(fileSystem.Path.Combine(postPath, postName))) + { + Tracing.Info(string.Format("The \"{0}\" file already exists", postName)); + return; + } + + fileSystem.File.WriteAllText(fileSystem.Path.Combine(postPath, postName), pageContents); + + Tracing.Info(string.Format("Created the \"{0}\" post ({1})", title, postName)); + } + } +} \ No newline at end of file diff --git a/src/Pretzel/Commands/IngredientCommand.cs b/src/Pretzel/Commands/IngredientCommand.cs index a3405e6b5..058740500 100644 --- a/src/Pretzel/Commands/IngredientCommand.cs +++ b/src/Pretzel/Commands/IngredientCommand.cs @@ -1,12 +1,10 @@ using Pretzel.Logic.Commands; using Pretzel.Logic.Extensions; -using System; -using System.Linq; +using Pretzel.Logic.Recipe; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.IO.Abstractions; -using Pretzel.Logic.Extensibility.Extensions; namespace Pretzel.Commands { @@ -30,32 +28,10 @@ public void Execute(IEnumerable arguments) parameters.Parse(arguments); - if (arguments.Count() == 0) - { - Tracing.Info("A title must be provided."); - return; - } + var title = parameters.NewPostTitle; - var title = arguments.First(); - var postPath = fileSystem.Path.Combine(fileSystem.Directory.GetCurrentDirectory(), @"_posts"); - var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(title)); - var pageContents = string.Format("---\r\n layout: post \r\n title: {0}\r\n comments: true\r\n---\r\n", title); - - if (!fileSystem.Directory.Exists(postPath)) - { - Tracing.Info("_posts folder not found."); - return; - } - - if (fileSystem.File.Exists(fileSystem.Path.Combine(postPath, postName))) - { - Tracing.Info(String.Format("The \"{0}\" file already exists", postName)); - return; - } - - fileSystem.File.WriteAllText(fileSystem.Path.Combine(postPath, postName), pageContents); - - Tracing.Info(String.Format("Created the \"{0}\" post ({1})", title, postName)); + var ingredient = new Ingredient(fileSystem, parameters.NewPostTitle, parameters.Path, parameters.IncludeDrafts); + ingredient.Create(); } public void WriteHelp(TextWriter writer) From 8282b6750dead507c58f803bc75aea3643ee64fe Mon Sep 17 00:00:00 2001 From: Keuvain Date: Thu, 10 Dec 2015 23:17:04 +0100 Subject: [PATCH 6/7] Added the tests for the Ingredient class --- src/Pretzel.Logic/Recipe/Ingredient.cs | 2 +- src/Pretzel.Tests/Pretzel.Tests.csproj | 1 + src/Pretzel.Tests/Recipe/IngredientTests.cs | 97 +++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/Pretzel.Tests/Recipe/IngredientTests.cs diff --git a/src/Pretzel.Logic/Recipe/Ingredient.cs b/src/Pretzel.Logic/Recipe/Ingredient.cs index 01b62df75..4a5d6966d 100644 --- a/src/Pretzel.Logic/Recipe/Ingredient.cs +++ b/src/Pretzel.Logic/Recipe/Ingredient.cs @@ -32,7 +32,7 @@ public void Create() if (!fileSystem.Directory.Exists(postPath)) { - Tracing.Info(string.Format("{0} folder not found.", postPath)); + Tracing.Info(string.Format("{0} folder not found", postPath)); return; } diff --git a/src/Pretzel.Tests/Pretzel.Tests.csproj b/src/Pretzel.Tests/Pretzel.Tests.csproj index 5f9d57dee..976957424 100644 --- a/src/Pretzel.Tests/Pretzel.Tests.csproj +++ b/src/Pretzel.Tests/Pretzel.Tests.csproj @@ -106,6 +106,7 @@ + diff --git a/src/Pretzel.Tests/Recipe/IngredientTests.cs b/src/Pretzel.Tests/Recipe/IngredientTests.cs new file mode 100644 index 000000000..422289459 --- /dev/null +++ b/src/Pretzel.Tests/Recipe/IngredientTests.cs @@ -0,0 +1,97 @@ +using NSubstitute; +using Pretzel.Logic.Extensibility; +using Pretzel.Logic.Extensibility.Extensions; +using Pretzel.Logic.Extensions; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.IO.Abstractions; +using System.IO.Abstractions.TestingHelpers; +using System.Linq; +using System.Text; +using System.Threading; +using Xunit; +using Xunit.Extensions; + +namespace Pretzel.Tests.Recipe +{ + public class IngredientTests + { + private MockFileSystem fileSystem = new MockFileSystem(new Dictionary()); + private const string BaseSite = @"c:\site\"; + private const string PostsFolder = @"_posts"; + private const string DraftsFolder = @"_drafts"; + + private readonly StringBuilder sb = new StringBuilder(); + private readonly TextWriter writer; + + public IngredientTests() + { + writer = new StringWriter(sb); + Tracing.Logger.SetWriter(writer); + Tracing.Logger.AddCategory(Tracing.Category.Info); + Tracing.Logger.AddCategory(Tracing.Category.Error); + Tracing.Logger.AddCategory(Tracing.Category.Debug); + } + + [Fact] + public void Post_Is_Created() + { + fileSystem.Directory.CreateDirectory(BaseSite + PostsFolder); + var postTitle = "Post title"; + var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(postTitle)); + + var ingredient = new Logic.Recipe.Ingredient(fileSystem, postTitle, BaseSite, false); + ingredient.Create(); + + Assert.True(fileSystem.File.Exists(fileSystem.Path.Combine(BaseSite + PostsFolder, postName))); + } + + [Fact] + public void Post_Has_Correct_Content() + { + fileSystem.Directory.CreateDirectory(BaseSite + PostsFolder); + var postTitle = "Post title"; + var expectedContent = string.Format("---\r\n layout: post \r\n title: {0}\r\n comments: true\r\n---\r\n", postTitle); + var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(postTitle)); + + var ingredient = new Logic.Recipe.Ingredient(fileSystem, "Post title", BaseSite, false); + ingredient.Create(); + + Assert.Equal(expectedContent, fileSystem.File.ReadAllText(fileSystem.Path.Combine(BaseSite + PostsFolder, postName))); + } + + [Fact] + public void Post_Already_Exists() + { + fileSystem.Directory.CreateDirectory(BaseSite + PostsFolder); + var postTitle = "Post title"; + var postName = string.Format("{0}-{1}.md", DateTime.Today.ToString("yyyy-MM-dd"), SlugifyFilter.Slugify(postTitle)); + + var ingredient = new Logic.Recipe.Ingredient(fileSystem, postTitle, BaseSite, false); + ingredient.Create(); + ingredient.Create(); + + Assert.Contains(string.Format("The \"{0}\" file already exists", postName), writer.ToString()); + } + + [Fact] + public void Post_Folder_Not_Found() + { + var ingredient = new Logic.Recipe.Ingredient(fileSystem, string.Empty, BaseSite, false); + ingredient.Create(); + + Assert.Contains(string.Format(@"{0} folder not found", BaseSite + PostsFolder), writer.ToString()); + } + + [Fact] + public void Draft_Folder_Not_Found() + { + var ingredient = new Logic.Recipe.Ingredient(fileSystem, string.Empty, BaseSite, true); + ingredient.Create(); + + Assert.Contains(string.Format(@"{0} folder not found", BaseSite + DraftsFolder), writer.ToString()); + } + } +} From 6718e583f68937d20250ef2cf318002df1c80dee Mon Sep 17 00:00:00 2001 From: Keuvain Date: Sun, 13 Dec 2015 17:09:58 +0100 Subject: [PATCH 7/7] Removed unused variable --- src/Pretzel/Commands/IngredientCommand.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Pretzel/Commands/IngredientCommand.cs b/src/Pretzel/Commands/IngredientCommand.cs index 058740500..dcf4490c1 100644 --- a/src/Pretzel/Commands/IngredientCommand.cs +++ b/src/Pretzel/Commands/IngredientCommand.cs @@ -28,8 +28,6 @@ public void Execute(IEnumerable arguments) parameters.Parse(arguments); - var title = parameters.NewPostTitle; - var ingredient = new Ingredient(fileSystem, parameters.NewPostTitle, parameters.Path, parameters.IncludeDrafts); ingredient.Create(); }