From 275cb5c92f4a4639a1fa51e79a81bb6c0f9bd49a Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 31 Jan 2020 00:40:25 +0100 Subject: [PATCH] scripts: dev_cli: Add clean command support Signed-off-by: Samuel Ortiz --- scripts/dev_cli.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 99775aa24..bf998b1c4 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -135,6 +135,9 @@ cmd_help() { echo " Build the Cloud Hypervisor container." echo " --dev Build dev container. This is the default." echo "" + echo " clean []]" + echo " Remove the Cloud Hypervisor artifacts." + echo "" echo " help" echo " Display this help message." echo "" @@ -180,6 +183,20 @@ cmd_build() { } } +cmd_clean() { + cargo_args=("$@") + + $DOCKER_RUNTIME run \ + -ti \ + --workdir "$CTR_CLH_ROOT_DIR" \ + --rm \ + --volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \ + "$CTR_IMAGE" \ + cargo clean \ + --target-dir "$CTR_CLH_CARGO_TARGET" \ + "${cargo_args[@]}" + } + cmd_tests() { unit=false cargo=false