@volter/twin-world 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/twin-world",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "World configs for twins: boot named local runtimes, allocate ports, generate world.env/instance.json, and run apps against fake-key twin worlds.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twin",
|
package/src/cli.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
2
3
|
import { spawnSync } from 'node:child_process';
|
|
3
4
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import { tmpdir } from 'node:os';
|
|
@@ -588,7 +589,8 @@ async function main(): Promise<void> {
|
|
|
588
589
|
caFile = join(mkdtempSync(join(tmpdir(), 'volter-attach-')), 'ca.pem');
|
|
589
590
|
writeFileSync(caFile, manifest.ca);
|
|
590
591
|
}
|
|
591
|
-
|
|
592
|
+
// The injector ships with @volter/twin (installed or workspace-linked); the sibling path is the bare checkout's.
|
|
593
|
+
const injectPath = (() => { try { return fileURLToPath(import.meta.resolve('@volter/twin/inject')); } catch { return resolvePath(import.meta.dir, '../../control-plane/inject.cjs'); } })();
|
|
592
594
|
const env = remoteAttachEnv(manifest, { injectPath, ...(caFile === undefined ? {} : { caFile }) });
|
|
593
595
|
const result = spawnSync(command[0]!, command.slice(1), { env: { ...process.env, ...env }, stdio: 'inherit' });
|
|
594
596
|
process.exit(result.status ?? 1);
|