Commit 8b0fbbcd authored by HgO's avatar HgO

cleanup corrupted built image when cube build script fails

parent f2a44105
......@@ -787,8 +787,14 @@ function download_image() {
debug $"Building internetcube image..."
check_sudo
sudo chmod u+x $CUBE_BUILD_SCRIPT_NAME
sudo "./$CUBE_BUILD_SCRIPT_NAME" "$ynh_image"
if ! sudo "./$CUBE_BUILD_SCRIPT_NAME" "$ynh_image"; then
# when the script fails, ensure that there isn't any corrupted built image left behind
rm -f "$image"
return 1
fi
rm -rf "$CUBE_BUILD_SCRIPT_DIR" "tmp"
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment