Files
Files copied to clipboard
Improve Rename API
Resolves #67
@clayellis Do you think this is still an issue with Files 4.0+?
@JohnSundell the surface area of the rename API didn't change between 3 and 4 — so I think the original motivations from #67 remain. However, I wasn't the one who brought up the issue, I just wrote the "fix", so I'm not super opinionated. Though, I do think this revision is a little more explicit and helps the user clarify their intent.
https://github.com/JohnSundell/Files/pull/124 is kinda related in terms of what name and what extension is, I suppose that for the hidden files the current PR implementation may treat name as an empty string
Example
.swiftlint
-> (change name to .swiftformat
) -> .swiftformat.swiftlint
.swiftlint
-> (change extension to yml
) -> .yml
Instead of
.swiftlint
-> (change name to .swiftformat
) -> .swiftformat
.swiftlint
-> (change extension to yml
) -> -> .swiftlint.yml
Btw I think that getting the name and the extension should probably work like this 🤔
.swiftlint
-> (name, extension) -> (".swiftlint"
, ""
)
.swiftlint.yml
-> (name, extension) -> (".swiftlint"
, "yml"
)
Maybe even (but the previous one is frankly better)
.swiftlint
-> (name, extension) -> (".swiftlint"
, "swiftlint"
)
.swiftlint.yml
-> (name, extension) -> (".swiftlint"
, "yml"
)
Closing, since it's been a few years without activity.