Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability To Clear Existing Directories Rather Than Delete #26

Merged
merged 2 commits into from Oct 24, 2011
Merged

Conversation

a-h
Copy link

@a-h a-h commented Oct 21, 2011

I generally want to copy an App_Offline.htm file into the remote application to take it offline while I'm working, so I then want to clear the directory rather than outright deleting it, while maintaining the existence of the app_offline.htm so that the site stays down.

I can then copy my Website over, then delete the app_offline.htm file to bring it back online.

unknown added 2 commits October 21, 2011 14:36
…learing all files so that I can set the directory to clear everything except the App_Offline.htm, which is the first thing I copy to the directory.
@ferventcoder
Copy link
Member

I am working this over a bit. I noticed there were no tests included. Hopefully the implementation is still pretty close to what was in line with your patch.

@ferventcoder
Copy link
Member

This is what it looks like now.

.ClearDestinationBeforeDeploying(except =>
                    {
                        except.Add(new Regex("[Aa]pp_[oO]ffline\.htm"));
                        except.Add(new Regex("anotherfile"));
                    });

@ferventcoder
Copy link
Member

I realize this isn't far from what it was prior. This is what the code looks like in the proto now.

        public void ClearDestinationBeforeDeploying()
        {
            _options = DestinationCleanOptions.Clear;
        }

        public void ClearDestinationBeforeDeploying(Action<IList<Regex>> excludePatterns)
        {
            excludePatterns(_clearIgnorePatterns);

            _options = DestinationCleanOptions.Clear;
        }

@ferventcoder
Copy link
Member

I also added exclude options to the copy task itself that follows the same principles.

@ferventcoder ferventcoder merged commit ce1c0c8 into chucknorris:master Oct 24, 2011
@ferventcoder
Copy link
Member

Tests and all for this guy.

@a-h
Copy link
Author

a-h commented Oct 24, 2011

Thanks a lot for merging that in. I'll take a look at what you've done to see how I can make sure that it fits in better next time. I was going to add the copy exclusions to source next (although you've already done it!) in order to be able to exclude .svn and .git directories from the copy operation.

@ferventcoder
Copy link
Member

@ferventcoder
Copy link
Member

I did alter that a clean does not delete any folder, just files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants