From f8f217ea9dbf42728fabee160ca2aa5fd28bb952 Mon Sep 17 00:00:00 2001 From: jjy Date: Fri, 22 Mar 2024 15:29:58 +0800 Subject: [PATCH] feat: support force redeploy cells --- src/subcommands/deploy/deployment.rs | 2 ++ src/subcommands/deploy/mod.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/subcommands/deploy/deployment.rs b/src/subcommands/deploy/deployment.rs index bd15e8de..49916f4c 100644 --- a/src/subcommands/deploy/deployment.rs +++ b/src/subcommands/deploy/deployment.rs @@ -27,6 +27,8 @@ pub struct Cell { pub name: String, pub location: CellLocation, pub enable_type_id: bool, + #[serde(default)] + pub force_redeploy: bool, } #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)] diff --git a/src/subcommands/deploy/mod.rs b/src/subcommands/deploy/mod.rs index f8f1eaba..5aa8fc3b 100644 --- a/src/subcommands/deploy/mod.rs +++ b/src/subcommands/deploy/mod.rs @@ -738,7 +738,8 @@ fn load_cells( let lock_script_unchanged = lock_script.as_slice() == old_lock_script.as_slice(); let type_id_unchanged = old_recipe.type_id.is_some() == config.enable_type_id; // NOTE: we trust `old_recipe.data_hash` here - if data_unchanged && lock_script_unchanged && type_id_unchanged { + if data_unchanged && lock_script_unchanged && type_id_unchanged && !cell.force_redeploy + { StateChange::Unchanged { data, data_hash,