buildwithnexus 0.2.4 → 0.2.5
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/dist/bin.js +10 -4
- package/dist/nexus-release.tar.gz +0 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -16,7 +16,7 @@ var BANNER = `
|
|
|
16
16
|
`;
|
|
17
17
|
function showBanner() {
|
|
18
18
|
console.log(BANNER);
|
|
19
|
-
console.log(chalk.dim(" v0.2.
|
|
19
|
+
console.log(chalk.dim(" v0.2.5 \xB7 buildwithnexus.dev\n"));
|
|
20
20
|
}
|
|
21
21
|
function showPhase(phase, total, description) {
|
|
22
22
|
const progress = chalk.cyan(`[${phase}/${total}]`);
|
|
@@ -500,16 +500,22 @@ async function createDisk(basePath, sizeGb) {
|
|
|
500
500
|
await execa("qemu-img", ["create", "-f", "qcow2", "-b", basePath, "-F", "qcow2", diskPath, `${sizeGb}G`], { env: scrubEnv() });
|
|
501
501
|
return diskPath;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function tryBind(port, host) {
|
|
504
504
|
return new Promise((resolve) => {
|
|
505
505
|
const server = net.createServer();
|
|
506
506
|
server.once("error", () => resolve(false));
|
|
507
507
|
server.once("listening", () => {
|
|
508
508
|
server.close(() => resolve(true));
|
|
509
509
|
});
|
|
510
|
-
server.listen(port,
|
|
510
|
+
server.listen(port, host);
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
|
+
async function isPortFree(port) {
|
|
514
|
+
const free0 = await tryBind(port, "0.0.0.0");
|
|
515
|
+
if (!free0) return false;
|
|
516
|
+
const free1 = await tryBind(port, "127.0.0.1");
|
|
517
|
+
return free1;
|
|
518
|
+
}
|
|
513
519
|
async function findFreePort(preferred, max = 20) {
|
|
514
520
|
for (let offset = 0; offset < max; offset++) {
|
|
515
521
|
const port = preferred + offset;
|
|
@@ -1623,7 +1629,7 @@ var brainstormCommand = new Command11("brainstorm").description("Brainstorm an i
|
|
|
1623
1629
|
});
|
|
1624
1630
|
|
|
1625
1631
|
// src/cli.ts
|
|
1626
|
-
var cli = new Command12().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version("0.2.
|
|
1632
|
+
var cli = new Command12().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version("0.2.5");
|
|
1627
1633
|
cli.addCommand(initCommand);
|
|
1628
1634
|
cli.addCommand(startCommand);
|
|
1629
1635
|
cli.addCommand(stopCommand);
|
|
Binary file
|