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

options unique & duplicatesFail overlap in functionality #134

Comments

@webketje
Copy link
Member

webketje commented Jan 3, 2023

The (way too complicated) matrix is:

  1. unique: false && duplicatesFail: false = overwrites dupes
  2. unique: false && duplicatesFail: true = throws
  3. unique: true && duplicatesFail: false = dedupes
  4. unique: true && duplicatesFail: true = throws (??)
  5. unique: function && duplicatesFail: false
  6. unique: function && duplicatesFail: true

Combo 1 is bad because having 2 files with the same target destination is not a good idea and much more likely to be unintentional. In 99% of cases permalinks should flag such an issue by throwing.

Combo 2 doesn't make sense: we first instruct permalinks to overwrite dupes, but then instruct it to throw when dupes are encountered

Combo 4 doesn't make sense: the current impl throws, but I would expect it to never throw as a postfix is added to each file. Then again I would also not expect to be able to specify duplicatesFail because it makes no sense in this context.

Conclusion

These options need to be bundled into 1 option duplicates: 'error'|'overwrite'|'index'|custom func. The default is 'error'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment