[bug] Resource cannot be found when productName contains a space (on Linux)
davi4046 opened this issue · 1 comments
Describe the bug
Tauri v2
My productName
in the tauri.conf.json
is "My App".
app compiles and works.
I resolve the path to a bundled resource file and try to open this file. The file is succesfully opened on Windows.
I try to resolve and open this same resource file on Linux and it fails with error "not found".
The resource does indeed exist in the /usr/lib/My App/resources
directory on the Linux machine.
As I see it, there are two reasons why this might fail:
- Tauri resolves the resource path without escaping the space in the "My App" productname.
- Tauri does escape the space but with two backslashes instead of one.
Solution:
Spaces in productName
should be escaped with a single backslash when resolving resources on Linux.
I have yet to see if the resource resolves correctly on my macOs build.
I know I can fix this manually by escaping the space myself, but this is undesired behavior and shoud be fixed.
Reproduction
- Create a new Tauri app.
- Set
productName
intauri.conf.json
to "My App" or any name with a space in it. - Specify a resource directory and put a file in it.
- Write a command that resolves the path to this resource and then tries to read/open it.
Shoud yield "not found" on Linux due to one of the above described reasons.
Expected behavior
The resource should be locatable on Linux, even when productName
contains spaces.
Full tauri info
output
guys, you don't need this cmon
Stack trace
No response
Additional context
No response
Nevermind. I just figured I need to wrap the resolved path in quotes before using it as command arg.