Skip to content

Commit 09ee8a0

Browse files
committed
backend: fix tauri precommands path resolution
Squash recent path fixes into one change. Make beforeDevCommand and beforeBuildCommand resolve Backend/Frontend paths at runtime so local cargo tauri dev and Windows GitHub workflows both find ensure-built-in-plugins.js reliably regardless of working directory.
1 parent 052cb50 commit 09ee8a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Backend/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"productName": "OpenVCS",
44
"identifier": "dev.jordon.openvcs",
55
"build": {
6-
"beforeDevCommand": "node ../Backend/scripts/ensure-built-in-plugins.js && npm run dev --prefix ../Frontend",
7-
"beforeBuildCommand": "node ../Backend/scripts/ensure-built-in-plugins.js && npm run build --prefix ../Frontend",
6+
"beforeDevCommand": "node -e \"const fs=require('fs'),path=require('path'),cp=require('child_process');const roots=['.','..'];const pick=(rel)=>roots.map((r)=>path.resolve(process.cwd(),r,rel)).find((p)=>fs.existsSync(p));const ensure=pick('Backend/scripts/ensure-built-in-plugins.js')||pick('scripts/ensure-built-in-plugins.js');const frontendPkg=pick('Frontend/package.json');if(!ensure||!frontendPkg){console.error('Could not resolve Backend/Frontend paths from',process.cwd());process.exit(1);}const npmBin=process.platform==='win32'?'npm.cmd':'npm';const npmScript=process.argv[1]||'build';let r=cp.spawnSync(process.execPath,[ensure],{stdio:'inherit'});if((r.status??1)!==0)process.exit(r.status??1);r=cp.spawnSync(npmBin,['run',npmScript,'--prefix',path.dirname(frontendPkg)],{stdio:'inherit'});process.exit(r.status??(r.error?1:0));\" dev",
7+
"beforeBuildCommand": "node -e \"const fs=require('fs'),path=require('path'),cp=require('child_process');const roots=['.','..'];const pick=(rel)=>roots.map((r)=>path.resolve(process.cwd(),r,rel)).find((p)=>fs.existsSync(p));const ensure=pick('Backend/scripts/ensure-built-in-plugins.js')||pick('scripts/ensure-built-in-plugins.js');const frontendPkg=pick('Frontend/package.json');if(!ensure||!frontendPkg){console.error('Could not resolve Backend/Frontend paths from',process.cwd());process.exit(1);}const npmBin=process.platform==='win32'?'npm.cmd':'npm';const npmScript=process.argv[1]||'build';let r=cp.spawnSync(process.execPath,[ensure],{stdio:'inherit'});if((r.status??1)!==0)process.exit(r.status??1);r=cp.spawnSync(npmBin,['run',npmScript,'--prefix',path.dirname(frontendPkg)],{stdio:'inherit'});process.exit(r.status??(r.error?1:0));\" build",
88
"devUrl": "http://localhost:1420",
99
"frontendDist": "../Frontend/dist"
1010
},

0 commit comments

Comments
 (0)