scripts: dev_cli: Add clean command support

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2020-01-31 00:40:25 +01:00 committed by Rob Bradford
parent 8676759c38
commit 275cb5c92f

View File

@ -135,6 +135,9 @@ cmd_help() {
echo " Build the Cloud Hypervisor container."
echo " --dev Build dev container. This is the default."
echo ""
echo " clean [<cargo args>]]"
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