diff --git a/plugin-runtime/scripts/generate-sea.cjs b/plugin-runtime/scripts/generate-sea.cjs index 2e962b4e..18c66603 100644 --- a/plugin-runtime/scripts/generate-sea.cjs +++ b/plugin-runtime/scripts/generate-sea.cjs @@ -1,6 +1,6 @@ const path = require('node:path'); const {execSync} = require('node:child_process'); -const {cpSync, mkdirSync, chmodSync, unlinkSync} = require('node:fs'); +const {cpSync, mkdirSync, chmodSync, unlinkSync, rmSync} = require('node:fs'); const pluginRuntimeDir = path.join(__dirname, '..'); const destDir = path.join(__dirname, '..', '..', 'src-tauri', 'vendored', 'plugin-runtime'); const blobPath = path.join(pluginRuntimeDir, 'yaak-plugins.blob'); @@ -63,4 +63,6 @@ const key = `${process.platform}_${process.env.NODE_ARCH ?? process.arch}`; const dstPath = path.join(destDir, DST_BIN_MAP[key]); cpSync(tmpNodePath, dstPath); +rmSync(tmp, {recursive: true, force: true}); + console.log(`Copied sea to ${dstPath}`) diff --git a/scripts/download-protoc.cjs b/scripts/download-protoc.cjs index 7aa41bc0..fb16ea3c 100644 --- a/scripts/download-protoc.cjs +++ b/scripts/download-protoc.cjs @@ -3,6 +3,7 @@ const Downloader = require("nodejs-file-downloader"); const path = require("node:path"); const fs = require("node:fs"); const rimraf = require('rimraf'); +const {rmSync} = require("node:fs"); // `${process.platform}_${process.arch}` const MAC_ARM = 'darwin_arm64'; @@ -57,5 +58,7 @@ const SRC_BIN_MAP = { const includeDst = path.join(dstDir, 'include'); fs.cpSync(includeSrc, includeDst, {recursive: true}); + rmSync(tmpDir, {recursive: true, force: true}); + console.log("Downloaded protoc to", binDst); })().catch(err => console.log('Script failed:', err));