Files
RuneStone/browser-runtime/scripts/stage-host.mjs
T

12 lines
713 B
JavaScript

import { cp, mkdir, access } from 'node:fs/promises';
import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const project = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const host = resolve(process.env.RUNESTONE_ROOT || resolve(project, '..'));
const source = resolve(project, `dist/RuneStone-Browser-${process.platform}-${process.arch}`);
await access(resolve(source, process.platform === 'win32' ? 'RuneStone-Browser.exe' : 'RuneStone-Browser'));
const destination = resolve(host, 'src-tauri/browser-engine');
await mkdir(destination, { recursive: true });
await cp(source, destination, { recursive: true });
console.log(`Browser runtime staged in ${destination}`);