build(release): remove old build script
This commit is contained in:
1 parent
0e295c8425
commit
cb117826c7
2 files changed
-41
No files matched your search
@@ -5,7 +5,6 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"debug": "bun run tauri dev",
|
"debug": "bun run tauri dev",
|
||||||
"build": "bun ./scripts/build.ts",
|
|
||||||
"release": "bun ./scripts/release.ts",
|
"release": "bun ./scripts/release.ts",
|
||||||
"release:macos": "bun ./scripts/release.ts macos",
|
"release:macos": "bun ./scripts/release.ts macos",
|
||||||
"release:windows": "bun ./scripts/release.ts windows",
|
"release:windows": "bun ./scripts/release.ts windows",
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
import { spawn } from 'child_process';
|
|
||||||
|
|
||||||
function runVite(): Promise<void> {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const proc = spawn('bunx', ['--bun', 'vite', 'build'], { stdio: ['inherit', 'pipe', 'pipe'] });
|
|
||||||
|
|
||||||
proc.stdout?.on('data', (data: Buffer) => {
|
|
||||||
process.stdout.write(data);
|
|
||||||
if (data.toString().includes('✔ done')) {
|
|
||||||
setTimeout(() => {
|
|
||||||
proc.kill();
|
|
||||||
resolve();
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
proc.stderr?.on('data', (data: Buffer) => process.stderr.write(data));
|
|
||||||
proc.on('close', (code) => {
|
|
||||||
if (code === 0 || code === null) resolve();
|
|
||||||
else reject(new Error(`vite build exited with code ${code}`));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function run(cmd: string, args: string[]): Promise<void> {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const proc = spawn(cmd, args, { stdio: 'inherit' });
|
|
||||||
proc.on('close', (code) => {
|
|
||||||
if (code === 0) resolve();
|
|
||||||
else reject(new Error(`${cmd} exited with code ${code}`));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
await run('bun', ['./scripts/sync-version.ts']);
|
|
||||||
await runVite();
|
|
||||||
|
|
||||||
//set NO_STRIP=1 in env for linux to prevent stripping of debug symbols in tauri builds, which causes issues with source maps
|
|
||||||
if (process.platform === 'linux') process.env.NO_STRIP = '1';
|
|
||||||
await run('bunx', ['tauri', 'build']);
|
|
||||||
Reference in new issue
Block a user