use crate::clouds::gcloud::storage;
use crate::common::*;
#[instrument(level = "trace", skip(ctx))]
pub(crate) async fn prepare_as_destination_helper(
ctx: Context,
gs_url: Url,
if_exists: IfExists,
) -> Result<()> {
if if_exists == IfExists::Overwrite {
storage::rm_r(&ctx, &gs_url).await?;
Ok(())
} else {
Err(format_err!(
"must specify `overwrite` for {} destination",
gs_url,
))
}
}