@tenux/cli 0.0.24 → 0.0.25
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 +20 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -759,12 +759,24 @@ async function handleServerStart(command, supabase) {
|
|
|
759
759
|
console.log(chalk3.dim(` cwd: ${fullPath}`));
|
|
760
760
|
const { data: sessionData } = await supabase.auth.getSession();
|
|
761
761
|
const accessToken = sessionData?.session?.access_token ?? "";
|
|
762
|
-
const
|
|
763
|
-
|
|
762
|
+
const configuredPort = payload.port;
|
|
763
|
+
const env = {
|
|
764
|
+
...process.env,
|
|
765
|
+
FORCE_COLOR: "0"
|
|
766
|
+
};
|
|
767
|
+
if (configuredPort) {
|
|
768
|
+
env.PORT = String(configuredPort);
|
|
769
|
+
console.log(chalk3.dim(` PORT=${configuredPort}`));
|
|
770
|
+
} else {
|
|
771
|
+
delete env.PORT;
|
|
772
|
+
}
|
|
764
773
|
delete env.NODE_OPTIONS;
|
|
765
774
|
const parts = payload.command.split(/\s+/).filter(Boolean);
|
|
766
775
|
const bin = parts[0];
|
|
767
|
-
|
|
776
|
+
let cmdArgs = parts.slice(1);
|
|
777
|
+
if (configuredPort && !cmdArgs.some((a) => a === "--port" || a === "-p")) {
|
|
778
|
+
cmdArgs = [...cmdArgs, "--port", String(configuredPort)];
|
|
779
|
+
}
|
|
768
780
|
const isWindows = process.platform === "win32";
|
|
769
781
|
const child = spawn2(bin, cmdArgs, {
|
|
770
782
|
cwd: fullPath,
|
|
@@ -855,19 +867,19 @@ async function handleServerStart(command, supabase) {
|
|
|
855
867
|
}).eq("id", instance.id);
|
|
856
868
|
setTimeout(async () => {
|
|
857
869
|
if (!detectedPort) {
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
860
|
-
managed.detectedPort =
|
|
870
|
+
const configuredPort2 = payload.port;
|
|
871
|
+
if (configuredPort2) {
|
|
872
|
+
managed.detectedPort = configuredPort2;
|
|
861
873
|
const tunnelUrl = connectTunnel(
|
|
862
874
|
instance.id,
|
|
863
|
-
|
|
875
|
+
configuredPort2,
|
|
864
876
|
accessToken,
|
|
865
877
|
command.user_id
|
|
866
878
|
);
|
|
867
879
|
managed.tunnelUrl = tunnelUrl;
|
|
868
880
|
await supabase.from("server_instances").update({
|
|
869
881
|
status: "running",
|
|
870
|
-
detected_port:
|
|
882
|
+
detected_port: configuredPort2,
|
|
871
883
|
tunnel_url: tunnelUrl,
|
|
872
884
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
873
885
|
}).eq("id", instance.id);
|