Skip to content

fix(tauri-utils): preserve resource source file name when dest is empty - #15383

Merged
Legend-Master merged 1 commit into
tauri-apps:devfrom
Legend-Master:no-dest-resource-target
May 16, 2026
Merged

fix(tauri-utils): preserve resource source file name when dest is empty#15383
Legend-Master merged 1 commit into
tauri-apps:devfrom
Legend-Master:no-dest-resource-target

Conversation

@Legend-Master

@Legend-Master Legend-Master commented May 15, 2026

Copy link
Copy Markdown
Contributor

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

@Legend-Master
Legend-Master requested a review from a team as a code owner May 15, 2026 03:33
@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 8bc1440

There are 4 changes which include tauri-bundler with minor, tauri-cli with minor, tauri-utils with minor, tauri-build with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.9.1 2.10.0
tauri-bundler 2.9.1 2.10.0
tauri-runtime 2.11.1 2.11.2
tauri-runtime-wry 2.11.1 2.11.2
tauri-codegen 2.6.1 2.6.2
tauri-macros 2.6.1 2.6.2
tauri-plugin 2.6.1 2.6.2
tauri-build 2.6.1 2.7.0
tauri 2.11.1 2.11.2
@tauri-apps/cli 2.11.1 2.11.2
tauri-cli 2.11.1 2.12.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Comment on lines +219 to +221
// 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)

@amrbashir amrbashir May 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain how is this confusing? for me at least I think of:

  1. README.md -> ./ or just . as $Resource/README.md
  2. README.md -> ./folder as $Resource/folder/README.md since it is a file
  3. directory -> ./ 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

@Legend-Master Legend-Master May 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. README.md -> ./folder as $Resource/folder/README.md since 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. README.md -> ./folder as $Resource/folder/README.md since it is a file
  2. directory -> ./ 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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, { "README.md": "./folder/" } must be written as ./folder/ not ./folder to put it at $RESOURCE/folder/README.md though

@Legend-Master
Legend-Master merged commit b5b72ce into tauri-apps:dev May 16, 2026
23 checks passed
@Legend-Master
Legend-Master deleted the no-dest-resource-target branch May 16, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Regression in tauri-utils 2.8.3: can no longer use "." as a destination path for a file resource

2 participants