Skip to content

Commit

Permalink
添加build脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
hanaTsuk1 committed Aug 2, 2024
1 parent a2dc949 commit 9c1d30d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"db:format": "prisma format",
"tauri": "tauri",
"tauri:dev": "tauri dev",
"tauri:build": "tauri build -c src-tauri/tauri.conf.build.json",
"tauri:build": "node scripts/build",
"release": "vue-tsc --noEmit && node scripts/release"
},
"dependencies": {
Expand Down
20 changes: 20 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'

import { execa } from 'execa'

const base = p => path.join(path.dirname(fileURLToPath(import.meta.url)), p)

const run = (bin, args, opts = {}) =>
execa(bin, args, { stdio: 'inherit', ...opts })

async function main() {
await run('cargo', ['build', '--release'], {
cwd: base('../src-autostart'),
})
await run('pnpm', ['tauri', 'build', '-c', 'src-tauri/tauri.conf.build.json'], {
cwd: base('../'),
})
}

main()

0 comments on commit 9c1d30d

Please sign in to comment.