Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Destination matching too aggressive #1130

Closed
bobeagan opened this Issue · 6 comments

3 participants

@bobeagan

I have my source in /httpdocs-uncompiled and asking to output to /httpdocs but get "Destination directory cannot be or contain the Source directory" when trying to build. If I change the destination in my _config.yml to something like ../site instead of ../httpdocs it works fine.

Assuming that it is just matching too aggressively from PR #535

@parkr
Owner

We just want to be really really really really sure we're not about to call Site#cleanup on your source or you'll lose everything. Is renaming your output/source dir too much of a hassle? I'm just afraid that if we loosen it too much more we'll end up with people killing off their sites by accident.

@parkr
Owner

I'm cool to find out if the destination contains source instead of just doing a silly regex like I think we do now.

@bobeagan

I've got a workaround in place for now but ideally I'd love to not have to change the names of the directories.

@maul-esel

Wouldn't just adding a trailing slash à la:

if self.source =~ /^#{self.dest}\//

fix this problem, or am I missing something?

@parkr
Owner

That would work if the source is a subdirectory or the same directory and contains the slash, and if the destination doesn't contain a trailing slash.

Kind of dicey.

@maul-esel

The solution is to make sure the slashes are in place :smile: (see here). It's a little hacky with the monkey-patching etc. but it works (and it can be done without hacks as well).

@maul-esel maul-esel referenced this issue
Merged

Dest match #1556

@mattr- mattr- closed this in bec4a07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.