Fix tmpdir on Windows

This commit is contained in:
Gregory Schier
2024-07-19 16:43:22 -07:00
parent 447932697d
commit a43f601b6a
4 changed files with 6 additions and 5 deletions

View File

@@ -1,2 +1,3 @@
build
node_modules
*.blob

View File

@@ -1,6 +1,5 @@
const path = require('node:path');
const {execSync} = require('node:child_process');
const {tmpdir} = require('node:os');
const {cpSync, mkdirSync, chmodSync, unlinkSync} = require('node:fs');
const pluginRuntimeDir = path.join(__dirname, '..');
const destDir = path.join(__dirname, '..', '..', 'src-tauri', 'vendored', 'plugin-runtime');
@@ -17,8 +16,8 @@ const DST_BIN_MAP = {
console.log('Building SEA blob');
execSync('node --experimental-sea-config sea-config.json', {cwd: pluginRuntimeDir});
const tmp = path.join(tmpdir(), new Date().toISOString());
mkdirSync(tmp);
const tmp = path.join(__dirname, '.tmp', new Date().toISOString());
mkdirSync(tmp, {recursive: true});
let tmpNodePath = process.platform === 'win32' ? path.join(tmp, 'node.exe') : path.join(tmp, 'node');