#Run a shortcut from JS API
10 messages Β· Page 1 of 1 (latest)
i guess basically this? https://tauri.app/v1/api/js/shell/#command
and if you wanna bundle that server with your tauri app, then probably this https://tauri.app/v1/guides/building/sidecar
Thank you for your quick reply π hmmm, so it becomes like this?
async function enterServer(serverIP) {
const serverPath = "path/to/server.exe";
const command = new Command("serverPath", ["-connect=serverIP"]);
await command.spawn();
}
yeah, basically
I'll test it out tomorrow, thank you π
@rich stirrup I got the following error:
Uncaught (in promise) program not allowed on the configured shell scope: serverPath
I have this on my tauri.config.js:
"allowlist": {
"all": true,
"shell": {
"all": true,
"execute": true,
"sidecar": true,
"open": true,
"scope": [
{
"name": "serverPath",
"cmd": "serverPath",
"args": ["-connect", { "validator": "\\S+" }]
},
]
}
},
"serverPath" must be an actual path, or the name of the binary
Hmm okok, but in the frontend the user specifies the folder path of the executable π€
that will be a bit more tricky then