@infosupport/huddle-cli 0.0.0-experiment-147.94.1 → 0.0.0-experiment-147.96.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/extension.js +7 -2
- package/dist/start.js +9 -8
- package/package.json +1 -1
package/dist/extension.js
CHANGED
|
@@ -124,8 +124,13 @@ function hasHuddleContainer(rt) {
|
|
|
124
124
|
* extension inactive.
|
|
125
125
|
*/
|
|
126
126
|
function restartRuntime(explicit, hasContainer = hasHuddleContainer, detect = () => (0, runtime_1.resolveRuntime)().name) {
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
const requested = explicit ?? process.env.HUDDLE_RUNTIME;
|
|
128
|
+
if (requested !== undefined) {
|
|
129
|
+
// An empty value is a typo, not a request to auto-detect: probing could pick another engine's container.
|
|
130
|
+
if (!requested)
|
|
131
|
+
throw new Error('--runtime must not be empty; choose docker or podman.');
|
|
132
|
+
return (0, runtime_1.resolveRuntime)(requested).name;
|
|
133
|
+
}
|
|
129
134
|
const owners = ['docker', 'podman'].filter((rt) => hasContainer(rt));
|
|
130
135
|
if (owners.length === 1)
|
|
131
136
|
return owners[0];
|
package/dist/start.js
CHANGED
|
@@ -80,18 +80,19 @@ async function runStart(opts) {
|
|
|
80
80
|
console.log(`Open in VS Code: ${(0, utils_1.cyan)('Dev Containers: Attach to Running Container')} -> ${(0, utils_1.bold)(result.containerName)}`);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
await tryPrintIdeLink(result.containerName);
|
|
83
|
+
await tryPrintSshLink(result.containerName);
|
|
85
84
|
}
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
// Same link as the portal's Connect IDE button: sets up sshd + the localhost
|
|
86
|
+
// relay and returns a jetbrains-gateway:// link. Best-effort: without an SSH key
|
|
87
|
+
// in Settings, or on an older image, the portal button explains what is missing.
|
|
88
|
+
async function tryPrintSshLink(containerName) {
|
|
88
89
|
try {
|
|
89
|
-
const res = await (0, api_1.get)(`/api/docker/containers/${encodeURIComponent(containerName)}/
|
|
90
|
+
const res = await (0, api_1.get)(`/api/docker/containers/${encodeURIComponent(containerName)}/ssh-link`);
|
|
90
91
|
if (res?.link)
|
|
91
|
-
console.log((0, utils_1.
|
|
92
|
+
console.log(`Open in JetBrains Gateway: ${(0, utils_1.cyan)(res.link)}`);
|
|
92
93
|
}
|
|
93
|
-
catch {
|
|
94
|
-
|
|
94
|
+
catch (err) {
|
|
95
|
+
console.log((0, utils_1.dim)(`No SSH link yet (${err?.message ?? err}); use Connect IDE in the Huddle portal.`));
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
function resolveWorkspace(workspace) {
|
package/package.json
CHANGED