#PluginInitialization("shell", "unknown field `allow`, expected `open`")
71 messages ยท Page 1 of 1 (latest)
I tried following this https://github.com/tauri-apps/plugins-workspace/blob/53c0e898608b2fe96d20e417905674ca41d8a089/examples/api/src-tauri/capabilities/base.json#L33-L42 but still get the same result, error.
This is my attempt, maybe my JSON is wrong..?
"plugins": {
"shell": {
"identifier": "shell:allow-execute",
"allow": [
{
"name": "legendary-auth",
"cmd": "legendary",
"args": [
"auth"
]
}
]
}
}```
```ts
import { Command } from "@tauri-apps/plugin-shell";
Command.create('legendary-auth', 'auth').execute()```
That syntax looks like you're editing src-tauri/tauri.conf.json rather than src-tauri/capabilities/default.json (might be called migrated.json).
Oh yeah, I'm editing src-tauri/tauri.conf.json. Has the file changed since? Where can I find some docs for the new file you're talking about?
It's also the file you linked ๐
You can call the capabilities files whatever you like, the default files are just called default and migrated depending on what generated them, create-tauri-app and tauri migrate respectively.
Oh, I didn't saw, I thought it was the same file as v1 :')
It works like a charm, thank you so much!
And where would I see all the options, for example for the fs?
You can point the $schema field at src-tauri/gen/schemas/acl-manifest.json or read the file manually. It's intended for editors to provide auto-complete so it's a little bit hard to read without formatting it.
My mistake. It was plural: acl-manifests.json.
Saw that yup. By the way in the link I provided, it pointed to desktop-schema.json. Is it normal or a bug?
That's normal.
Doesn't seem to privode autocomplete on my end, weird. I'm trying to see all the identifiers for fs but can't even find one if I ctrl+f in acl-manifests.json
Hm... seems it's in a different format than I remember. Maybe it was the desktop-schema.json file instead.
Oh, see it already there, I'm blind
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"event:default",
"window:default",
"app:default",
"image:default",
"resources:default",
"menu:default",
"tray:default",
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "legendary-auth",
"cmd": "legendary",
"args": [
"auth"
]
}
]
},
"path:allow-join"
]
}``` it only wants to autocomplete the shell identifier, why? It's frustrating me so much haha
What editor are you using?
VSCode
It generates the schema files every build so you should have more than shell in there.
Wherever I try to add another thing, for the allow path, it tries and wants to autocomplete for the shell
Oh, that's a side-effect of the way the schema is handled.
And in the examples I can see fs used, and I can only see path
What permission were you trying to add?
A permission to allow me to edit the .zshrc file in the home directory for example
You also have to reload VSCode to get it to pick up the schema again.
I find that really annoying too ๐
Let me try by reloading it
There's even a JSON: Clear Schema Cache command but it doesn't seem to make a difference.
Nothing changed. Also, in my shell identifier it throws me a warning because there is no command and sidecar property
Have you run tauri dev or tauri build since you added the plugins?
Well, just did but nothing changed
Seems regenerating the schemas has broken for some reason. It doesn't overwrite the existing files.
Should be fine to delete gen/schemas so it get generated next build.
I'll look into the cause when I have a moment in the evening.
Deleted the schemas, got them again but same problem unfortunately
I found my first bug ๐ฅณ
Can you upload a minimum reproduction to GitHub?
If you've only got the output of create-tauri-app so far, that works too.
I just got the basic file from bun create tauri-app@latest -- --beta, nothing changed. How would I get a minimum reproduction..? ^^'
Did you also run tauri add fs?
That's just a shortcut to automatically add the plugin. You could also have manually added it to Cargo.toml, package.json, and lib.rs.
More detailed instructions can be found in the README or on the website: https://beta.tauri.app/features/file-system/.
I'm just a fool who tried to do his stuff in the wrong order
Guess who has autocomplete for fs now
That's good. I thought something had gone wrong in the ACL which is code I haven't looked at yet.
It's usual on my end when I have a problem haha, don't worry
So whenever I want to add any identifier, I need to add it to Tauri first right?
Only if it's a plugin.
Most stuff is a plugin though.
The list of stuff that's not a plugin can be found at https://beta.tauri.app/references/v2/js/core/.
Got it. One last thing, my command works but why doesn't it accept my shell:allow-execute? It throws me a warning there, it wants any fs identifier
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"event:default",
"window:default",
"app:default",
"image:default",
"resources:default",
"menu:default",
"tray:default",
"fs:default",
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "legendary-auth",
"cmd": "legendary",
"args": [
"auth"
]
}
]
}
]
}```
Not sure what causes that behaviour. It doesn't seem to cause any compile errors so it's probably just a problem with the schema file.
Maybe I should try to delete it again? Or wait for a future update
Future update, I tried deleting it and it didn't make a difference.
And quick question, is the upgrade command the same as the install command for beta?
Upgrade command?
You mean with pnpm and Yarn?
I think they behave the same when you specify a package and version.
Bun ๐
I don't see a bun upgrade in their docs.
So still bun create tauri-app@latest -- --beta?
I don't know if the extra -- is needed for Bun but yes, that should do it.