@getmonoceros/workbench 1.5.2 → 1.5.3
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 +12 -4
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -3494,13 +3494,21 @@ async function runRemove(opts) {
|
|
|
3494
3494
|
const script = [
|
|
3495
3495
|
`set -u`,
|
|
3496
3496
|
`echo "[remove] tearing down docker project ${projectName}\u2026"`,
|
|
3497
|
-
// Compose-mode containers, identified by the project label
|
|
3497
|
+
// Compose-mode containers, identified by the compose project label.
|
|
3498
3498
|
`by_label=$(docker ps -aq --filter "label=com.docker.compose.project=${projectName}" 2>/dev/null || true)`,
|
|
3499
|
-
//
|
|
3499
|
+
// Devcontainer-cli containers (image-mode workspace + feature-
|
|
3500
|
+
// build intermediates) all carry this label, value = the absolute
|
|
3501
|
+
// container-dir path. Most reliable anchor we have, because
|
|
3502
|
+
// @devcontainers/cli lets Docker assign random names like
|
|
3503
|
+
// 'kind_cerf' — neither the project-name nor the vsc-<name>-
|
|
3504
|
+
// prefix filters below catch those.
|
|
3505
|
+
`by_dc_label=$(docker ps -aq --filter "label=devcontainer.local_folder=${containerPath}" 2>/dev/null || true)`,
|
|
3506
|
+
// Container-name prefix fallback (catches half-broken state).
|
|
3500
3507
|
`by_compose_name=$(docker ps -aq --filter "name=^${projectName}-" 2>/dev/null || true)`,
|
|
3501
|
-
// Image-mode devcontainer-cli
|
|
3508
|
+
// Image-mode devcontainer-cli name fallback (only kicks in when
|
|
3509
|
+
// the cli used a deterministic name — modern versions don't).
|
|
3502
3510
|
`by_image_name=$(docker ps -aq --filter "name=^vsc-${opts.name}-" 2>/dev/null || true)`,
|
|
3503
|
-
`to_remove=$(printf "%s\\n%s\\n%s\\n" "$by_label" "$by_compose_name" "$by_image_name" | sort -u | grep -v "^$" || true)`,
|
|
3511
|
+
`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)`,
|
|
3504
3512
|
`if [ -n "$to_remove" ]; then echo "[remove] removing containers: $(echo $to_remove | tr "\\n" " ")"; docker rm -f $to_remove >/dev/null || true; else echo "[remove] no containers found"; fi`,
|
|
3505
3513
|
`docker network rm ${projectName}_default 2>/dev/null && echo "[remove] network ${projectName}_default removed" || true`,
|
|
3506
3514
|
`echo "[remove] docker cleanup done"`
|