Skip to content

Commit e1a29e3

Browse files
authored
Merge pull request #3 from ZeroKnowledgeNetwork/2-fix-tauri-shell-scope-for-chmod-on-macos
refactor: use explicit cmd args and cwd files
2 parents 84b4f05 + aed0c7b commit e1a29e3

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

src-tauri/capabilities/default.json

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,9 @@
3737
"identifier": "shell:allow-execute",
3838
"allow": [
3939
{
40-
"name": "chmod+x",
40+
"name": "chmod-walletshield",
4141
"cmd": "chmod",
42-
"args": [
43-
"+x",
44-
{
45-
"validator": "\\S+"
46-
}
47-
],
42+
"args": ["+x", "walletshield"],
4843
"sidecar": false
4944
}
5045
]
@@ -55,14 +50,7 @@
5550
{
5651
"name": "walletshield-listen",
5752
"cmd": "walletshield",
58-
"args": [
59-
"-listen",
60-
":7070",
61-
"-config",
62-
{
63-
"validator": "\\S+"
64-
}
65-
],
53+
"args": ["-listen", ":7070", "-config", "client.toml"],
6654
"sidecar": false
6755
}
6856
]

src/App.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ function App() {
166166
// prepare the walletshield binary for execution
167167
////////////////////////////////////////////////////////////////////////
168168
if (platform() === "linux" || platform() === "macos") {
169-
const output = await Command.create("chmod+x", [
170-
"+x",
171-
fileWalletshield,
172-
]).execute();
169+
log.debug(`executing command: chmod +x walletshield`);
170+
const output = await Command.create(
171+
"chmod-walletshield",
172+
["+x", "walletshield"],
173+
{
174+
cwd: dirNetwork,
175+
},
176+
).execute();
173177
if (output.code !== 0) {
174178
throw new Error(`Failed to chmod+x walletshield: ${output.stderr}`);
175179
}
@@ -181,7 +185,7 @@ function App() {
181185
setMsgType(() => "info");
182186
setMsg(() => `Starting network client...`);
183187
const cmd = "walletshield";
184-
const args = ["-listen", ":7070", "-config", fileClientCfg];
188+
const args = ["-listen", ":7070", "-config", "client.toml"];
185189
const command = Command.create("walletshield-listen", args, {
186190
cwd: dirNetwork,
187191
env: {

0 commit comments

Comments
 (0)