From 1a0e7f969f864bd20519cd4b5869267a0cae9298 Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Thu, 2 May 2024 10:17:46 +0200 Subject: [PATCH] Add purge containers --- content/config/nushell/aliases.nu.tmpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/config/nushell/aliases.nu.tmpl b/content/config/nushell/aliases.nu.tmpl index 5ecaed3..e2d5972 100644 --- a/content/config/nushell/aliases.nu.tmpl +++ b/content/config/nushell/aliases.nu.tmpl @@ -15,4 +15,18 @@ alias `shx` = sudo -E helix -c '{{dirs.config}}/helix/config.toml' alias devshell = nix develop -c $env.SHELL {{/if-installed}} +{{#if-installed docker}} +# purge all containers +def `docker purge-containers` [] { + ( docker container ls -a --format json + | lines + | each { + let id = (from json | get id); + docker container stop $id; + docker container rm $id; + } + ) +} +{{/if-installed}} + def --env `silo cd` [] { silo repo | cd $in }