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

Compilation fails when creating a folder when file exists in output folder #942

Closed
myncke opened this Issue Sep 6, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@myncke
Copy link

myncke commented Sep 6, 2016

Summary

File does not get deleted in output folder prior to creating new folder.

Steps to reproduce

  1. make file without extension
  2. make a route to create a folder with the file name of step 1

Expected behavior

Delete the file, create the folder.

Actual behavior

Crashes

Crash log

https://gist.github.com/myncke/e2aeed489eda1d3131e08385724919df

@ddfreyne

This comment has been minimized.

Copy link
Member

ddfreyne commented Sep 26, 2016

This situation is tricky to solve in a general way, because there’s situations in which the expected behavior is not so clear. For example:

  1. Route one item to /foo
  2. Route another item to /foo/bar

In this case, the proper solution is to error out. (With whatever is the most appropriate error—which might or might not be Errno::EEXIST.)

For this bug in particular, though, it seems that changing the order of pruning and compiling so that pruning is done first, rather than last, would solve the problem. The caveat here is that if pruning is not enabled, this error will still occur… which I believe is fine.

ddfreyne added a commit that referenced this issue Sep 26, 2016

@ddfreyne

This comment has been minimized.

Copy link
Member

ddfreyne commented Sep 26, 2016

Fix in #946.

@ddfreyne ddfreyne added this to the 4.3.3 milestone Sep 26, 2016

ddfreyne added a commit that referenced this issue Sep 26, 2016

Merge pull request #946 from nanoc/prune-before-compile
Prune before compiling (fixes #942)

@ddfreyne ddfreyne closed this Sep 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.