fix(tauri-utils): preserve resource source file name when dest is empty - #15383
Conversation
Package Changes Through 8bc1440There are 4 changes which include tauri-bundler with minor, tauri-cli with minor, tauri-utils with minor, tauri-build with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
| // TODO: This behavior is a confusing special case, | ||
| // remove this in v3 or make other cases like this work | ||
| // > `{ "README.md": "./folder/" }` is `README.md` -> `$RESOURCE/folder/README.md` (this gives `$RESOURCE/folder` today) |
There was a problem hiding this comment.
Can you explain how is this confusing? for me at least I think of:
README.md->./or just.as$Resource/README.mdREADME.md->./folderas$Resource/folder/README.mdsince it is a filedirectory->./or just.as$Resource/directory
The one I actually think of as confusing is this:
4. directory -> ./folder as $Resource/folder, it should be $Resource/folder/directory
Overall I think we should be following the behavior of cp command on unix
There was a problem hiding this comment.
README.md->./folderas$Resource/folder/README.mdsince it is a file
We can not tell if the target ./folder is a folder (we can if it's written as ./folder/ though), so it gives $RESOURCE/folder today, and that's the confusing part
There was a problem hiding this comment.
README.md->./folderas$Resource/folder/README.mdsince it is a filedirectory->./or just.as$Resource/directory
I don't think these were the case? At least not when I wrote https://tauri.app/develop/resources/#tab-panel-715 🤔 (I wrote it based on the actual behavior we had I believe)
There was a problem hiding this comment.
I really don't know how it behaves atm, but if we plan to break this in a new major, I would just suggest being close as possible to cp command, it makes it more obvious and familiar and less confusing
There was a problem hiding this comment.
That makes sense, { "README.md": "./folder/" } must be written as ./folder/ not ./folder to put it at $RESOURCE/folder/README.md though
Fix #15380, regression from #14662
Apparently #14662 (comment) is possible
This behavior is confusing, but we should still keep it in v2 for the compatibility