Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

Prune packaged runtime by target

wytacb0ced99146
diff --git a/scripts/ensure-runtime-before-pack.cjs b/scripts/ensure-runtime-before-pack.cjs
index 6fdf7da5..4ca22c7d 100755
--- a/scripts/ensure-runtime-before-pack.cjs
+++ b/scripts/ensure-runtime-before-pack.cjs
@@ -2,6 +2,7 @@
'use strict';
const path = require('node:path');
+const fs = require('node:fs');
const { spawnSync } = require('node:child_process');
const ARCH_MAP = new Map([
@@ -21,8 +22,29 @@ function normalizeArch(value) {
return ARCH_MAP.get(String(value)) || String(value || process.arch);
}
+function platformKey(platform, arch) {
+ return `${platform}-${arch}`;
+}
+
+function pruneRuntimeRoot(root, keys) {
+ const allowed = new Set(keys);
+ for (const kind of ['python', 'uv']) {
+ const kindDir = path.join(root, kind);
+ if (!fs.existsSync(kindDir) || !fs.statSync(kindDir).isDirectory()) {
+ continue;
+ }
+ for (const entry of fs.readdirSync(kindDir, { withFileTypes: true })) {
+ if (!entry.isDirectory() || allowed.has(entry.name)) {
+ continue;
+ }
+ fs.rmSync(path.join(kindDir, entry.name), { recursive: true, force: true });
+ }
+ }
+}
+
module.exports = async function ensureRuntimeBeforePack(context) {
const pcRoot = path.resolve(__dirname, '..');
+ const runtimeRoot = path.join(pcRoot, 'resources', 'runtime');
const platform = context && context.electronPlatformName
? String(context.electronPlatformName)
: process.platform;
@@ -32,7 +54,7 @@ module.exports = async function ensureRuntimeBeforePack(context) {
for (const targetArch of arches) {
const res = spawnSync(process.execPath, [
path.join(pcRoot, 'bin', 'ensure-runtime.cjs'),
- '--root', path.join(pcRoot, 'resources', 'runtime'),
+ '--root', runtimeRoot,
'--platform', platform,
'--arch', targetArch,
], {
@@ -46,4 +68,6 @@ module.exports = async function ensureRuntimeBeforePack(context) {
throw new Error(`ensure-runtime failed for ${platform}-${targetArch} with status ${res.status}`);
}
}
+
+ pruneRuntimeRoot(runtimeRoot, arches.map(targetArch => platformKey(platform, targetArch)));
};