Skip to content

Conversation

josevalim
Copy link
Member

@josevalim josevalim commented Jul 26, 2022

Closes #11715.

@@ -861,6 +869,18 @@ defmodule File do
explicitly disallow this behaviour. If `source` is a `file` and `destination`
is a directory, `{:error, :eisdir}` will be returned.

## Options

* `:on_conflict` - Invoked a file already exists in the destination. The function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `:on_conflict` - Invoked a file already exists in the destination. The function
* `:on_conflict` - Invoked if file already exists in the destination. The function


* `:dereference_symlinks` - By default, this function will copy symlinks by creating
symlinks that point to the same location. This option forces symlinks to be dereferenced
and have their contents copied instead when set to true. If the dereferenced files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and have their contents copied instead when set to true. If the dereferenced files
and have their contents copied instead when set to `true`. If the dereferenced files

Comment on lines 781 to 783
An optional `on_conflict` callback is invoked if the `destination_file` already
exists. The function receives arguments for `source_file` and `destination_file`.
It should return `true` if the existing file should be overwritten, `false` if
Copy link
Contributor

@v0idpwn v0idpwn Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the to-be-deprecated clauses could be be mentioned (and discouraged) in the documentation until they are officially deprecated? Otherwise they get on a limbo, where they are allowed to be used but not documented, which can be confusing: "If I'm giving a function as argument instead of a list of options, why does it work?".

@josevalim josevalim merged commit e453a75 into main Jul 26, 2022
@josevalim josevalim deleted the jv-deref-symlinks branch July 26, 2022 13:02
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

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

Successfully merging this pull request may close these issues.

Bring build_embedded: Mix.env() == :prod back to mix new or deep copy syminks
3 participants