Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed exit code and readonly issues with removing temp directories
  • Loading branch information
jmarnold committed Dec 2, 2011
1 parent 96a78a9 commit 9fa6179
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Fubu/NewCommand.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Bottles.Zipping;
using Fubu.Templating;
using Fubu.Templating.Steps;
Expand Down Expand Up @@ -53,7 +54,7 @@ public override bool Execute(NewCommandInput input)
Console.ForegroundColor = ConsoleColor.Red;
ctx.Errors.Each(error => Console.WriteLine(error));
Console.ForegroundColor = ConsoleColor.White;
hasErrors = true;
hasErrors = ctx.Errors.Any();
});

if (hasErrors)
Expand Down
13 changes: 13 additions & 0 deletions src/Fubu/Templating/Steps/MoveContent.cs
Expand Up @@ -56,6 +56,19 @@ public void Execute(TemplatePlanContext context)
}
_fileSystem.MoveDirectory(directory, destination);
});

var info = new DirectoryInfo(context.TempDir);
info
.EnumerateDirectories(".git")
.First()
.EnumerateFiles("*.*", SearchOption.AllDirectories)
.Each(fileInfo =>
{
fileInfo.IsReadOnly = false;
});
info.Attributes &= ~FileAttributes.ReadOnly;

_fileSystem.DeleteDirectory(context.TempDir);
}
}
}

0 comments on commit 9fa6179

Please sign in to comment.