Closed dominikj111 closed 2 years ago
This path is correct, it is not the current working dir of the app, but our recommended path for app related configs and stuff,see https://tauri.app/v1/api/js/modules/path#appdir
Ah, ok ... well my problem is that I would to load my svg files into the application and I would to have them editable without rebuilding the app. Usually (java), I have a folder with assets and providing them to the app when needed. I'm not sure what is correct way in this case.
Well the thing is that the location where your app is installed is most likely read-only. So you're better of just using a user data dir as your "shared" folder.
Describe the bug
Under dev mode
pnpm tauri dev
, theconst contents = await readTextFile('app.conf', { dir: BaseDirectory.App });
tries to get the app.conf file from the/Users/me/Library/Application Support/com.tauri.dev/app.conf
, but this location doesn't exist. On the other hand theconst resourcePath = await resolveResource("app.conf");
set theresourcePath
to/Users/me/my/Development/sandbox/edu/src-tauri/target/debug/app.conf
what looks correct to me.Reproduction
import { readTextFile, BaseDirectory } from "@tauri-apps/api/fs";
api to read any text fileExpected behavior
I would to expect to read the text file from the folder where the actual application is.
Platform and versions
Stack trace
No response
Additional context
No response