@getmonoceros/workbench 1.11.3 → 1.11.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 +30 -5
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -3957,7 +3957,12 @@ var spawnBash = (args, cwd) => {
|
|
|
3957
3957
|
return new Promise((resolve, reject) => {
|
|
3958
3958
|
const child = spawn5("bash", args, {
|
|
3959
3959
|
cwd,
|
|
3960
|
-
stdio: ["inherit", "pipe", "pipe"]
|
|
3960
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
3961
|
+
env: {
|
|
3962
|
+
...process.env,
|
|
3963
|
+
MSYS_NO_PATHCONV: "1",
|
|
3964
|
+
MSYS2_ARG_CONV_EXCL: "*"
|
|
3965
|
+
}
|
|
3961
3966
|
});
|
|
3962
3967
|
child.stdout?.pipe(createSecretMaskStream()).pipe(process.stdout);
|
|
3963
3968
|
child.stderr?.pipe(createSecretMaskStream()).pipe(process.stderr);
|
|
@@ -3965,6 +3970,13 @@ var spawnBash = (args, cwd) => {
|
|
|
3965
3970
|
child.on("exit", (code) => resolve(code ?? 0));
|
|
3966
3971
|
});
|
|
3967
3972
|
};
|
|
3973
|
+
function dockerLocalFolderLabel(p) {
|
|
3974
|
+
if (process.platform !== "win32") return p;
|
|
3975
|
+
return p.replace(
|
|
3976
|
+
/^([A-Z]):/,
|
|
3977
|
+
(_, drive) => `${drive.toLowerCase()}:`
|
|
3978
|
+
);
|
|
3979
|
+
}
|
|
3968
3980
|
function composeProjectName(root) {
|
|
3969
3981
|
return `${path11.basename(root)}_devcontainer`;
|
|
3970
3982
|
}
|
|
@@ -4012,7 +4024,11 @@ async function runContainerCycle(root, opts) {
|
|
|
4012
4024
|
`by_label=$(docker ps -aq --filter "label=com.docker.compose.project=${projectName}" 2>/dev/null || true)`,
|
|
4013
4025
|
`by_name=$(docker ps -aq --filter "name=^${projectName}-" 2>/dev/null || true)`,
|
|
4014
4026
|
`to_remove=$(printf "%s\\n%s\\n" "$by_label" "$by_name" | sort -u | grep -v "^$" || true)`,
|
|
4015
|
-
|
|
4027
|
+
// Unquoted `$to_remove` so bash word-splitting joins the
|
|
4028
|
+
// newline-separated IDs with single spaces on echo. A `tr "\n" " "`
|
|
4029
|
+
// pipe here used to do the same job but tripped MSYS2's arg
|
|
4030
|
+
// translation on Git Bash for Windows ("tr: extra operand").
|
|
4031
|
+
`if [ -n "$to_remove" ]; then echo "[cleanup] removing:" $to_remove; docker rm -f $to_remove >/dev/null || true; else echo "[cleanup] no containers to remove"; fi`,
|
|
4016
4032
|
`docker network rm ${projectName}_default 2>/dev/null && echo "[cleanup] network ${projectName}_default removed" || echo "[cleanup] network ${projectName}_default not present"`,
|
|
4017
4033
|
`remaining_label=$(docker ps -aq --filter "label=com.docker.compose.project=${projectName}" 2>/dev/null || true)`,
|
|
4018
4034
|
`remaining_name=$(docker ps -aq --filter "name=^${projectName}-" 2>/dev/null || true)`,
|
|
@@ -4697,7 +4713,7 @@ async function persistPromptedIdentity(prompted, ymlPath, home, logger) {
|
|
|
4697
4713
|
}
|
|
4698
4714
|
|
|
4699
4715
|
// src/version.ts
|
|
4700
|
-
var CLI_VERSION = true ? "1.11.
|
|
4716
|
+
var CLI_VERSION = true ? "1.11.5" : "dev";
|
|
4701
4717
|
|
|
4702
4718
|
// src/commands/_dispatch.ts
|
|
4703
4719
|
import { consola as consola12 } from "consola";
|
|
@@ -6166,14 +6182,23 @@ async function runRemove(opts) {
|
|
|
6166
6182
|
// @devcontainers/cli lets Docker assign random names like
|
|
6167
6183
|
// 'kind_cerf' — neither the project-name nor the vsc-<name>-
|
|
6168
6184
|
// prefix filters below catch those.
|
|
6169
|
-
|
|
6185
|
+
// dockerLocalFolderLabel() lowercases the drive letter on Windows
|
|
6186
|
+
// to match exactly what @devcontainers/cli stamps (`c:\…` vs our
|
|
6187
|
+
// `path.join`-built `C:\…`). Docker label filters are strict
|
|
6188
|
+
// byte-equality, so the case difference was leaving containers
|
|
6189
|
+
// alive on `monoceros remove`.
|
|
6190
|
+
`by_dc_label=$(docker ps -aq --filter "label=devcontainer.local_folder=${dockerLocalFolderLabel(containerPath)}" 2>/dev/null || true)`,
|
|
6170
6191
|
// Container-name prefix fallback (catches half-broken state).
|
|
6171
6192
|
`by_compose_name=$(docker ps -aq --filter "name=^${projectName}-" 2>/dev/null || true)`,
|
|
6172
6193
|
// Image-mode devcontainer-cli name fallback (only kicks in when
|
|
6173
6194
|
// the cli used a deterministic name — modern versions don't).
|
|
6174
6195
|
`by_image_name=$(docker ps -aq --filter "name=^vsc-${opts.name}-" 2>/dev/null || true)`,
|
|
6175
6196
|
`to_remove=$(printf "%s\\n%s\\n%s\\n%s\\n" "$by_label" "$by_dc_label" "$by_compose_name" "$by_image_name" | sort -u | grep -v "^$" || true)`,
|
|
6176
|
-
|
|
6197
|
+
// Unquoted `$to_remove` so bash word-splitting joins the
|
|
6198
|
+
// newline-separated IDs with single spaces on echo. A `tr "\n" " "`
|
|
6199
|
+
// pipe here used to do the same job but tripped MSYS2's arg
|
|
6200
|
+
// translation on Git Bash for Windows ("tr: extra operand").
|
|
6201
|
+
`if [ -n "$to_remove" ]; then echo "[remove] removing containers:" $to_remove; docker rm -f $to_remove >/dev/null || true; else echo "[remove] no containers found"; fi`,
|
|
6177
6202
|
`docker network rm ${projectName}_default 2>/dev/null && echo "[remove] network ${projectName}_default removed" || true`,
|
|
6178
6203
|
`echo "[remove] docker cleanup done"`
|
|
6179
6204
|
].join("; ");
|