whipped 0.1.0 → 0.1.1
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/cli.js +1 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8991,7 +8991,6 @@ var require_tree_kill = __commonJS({
|
|
|
8991
8991
|
});
|
|
8992
8992
|
|
|
8993
8993
|
// src/cli.ts
|
|
8994
|
-
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
8995
8994
|
import { createServer as createServer2 } from "node:net";
|
|
8996
8995
|
|
|
8997
8996
|
// node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
|
|
@@ -28546,15 +28545,7 @@ process.on("uncaughtException", (err) => {
|
|
|
28546
28545
|
if (err.code === "EPIPE" || err.code === "ECONNRESET") return;
|
|
28547
28546
|
throw err;
|
|
28548
28547
|
});
|
|
28549
|
-
var VERSION9 = true ? "0.1.
|
|
28550
|
-
function hasGitRepository(path2) {
|
|
28551
|
-
const result = spawnSync11("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
28552
|
-
cwd: path2,
|
|
28553
|
-
encoding: "utf8",
|
|
28554
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
28555
|
-
});
|
|
28556
|
-
return result.status === 0 && result.stdout.trim() === "true";
|
|
28557
|
-
}
|
|
28548
|
+
var VERSION9 = true ? "0.1.1" : "0.0.0-dev";
|
|
28558
28549
|
async function isPortAvailable(port, host) {
|
|
28559
28550
|
return new Promise((resolve5) => {
|
|
28560
28551
|
const probe = createServer2();
|
|
@@ -28565,10 +28556,6 @@ async function isPortAvailable(port, host) {
|
|
|
28565
28556
|
async function runServerForeground(options) {
|
|
28566
28557
|
const { port, host } = options;
|
|
28567
28558
|
const repoPath = process.cwd();
|
|
28568
|
-
if (!hasGitRepository(repoPath)) {
|
|
28569
|
-
logger.error("Error: whipped must be run inside a git repository.");
|
|
28570
|
-
process.exit(1);
|
|
28571
|
-
}
|
|
28572
28559
|
const portAvailable = await isPortAvailable(port, host);
|
|
28573
28560
|
if (!portAvailable) {
|
|
28574
28561
|
logger.error(`Error: port ${port} is already in use. Use --port to specify a different port.`);
|