aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar lancebord 2026-03-03 12:10:39 -0500
committerGravatar lancebord 2026-03-03 12:10:39 -0500
commit4db8f1cedf34dc0796ca7ad56e47d2c587ece300 (patch)
treec47be1e17481fb036be5f2e1ff8c125a41295018 /src
parentupdate pull to tag to not user merge logic (diff)
make add checkout tag on tagged update mode
Diffstat (limited to 'src')
-rw-r--r--src/action.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/action.rs b/src/action.rs
index dba937e..e69d79d 100644
--- a/src/action.rs
+++ b/src/action.rs
@@ -105,6 +105,15 @@ fn add(url: &str) -> Result<(), String> {
repo.path().to_str().unwrap()
);
+ // if configured for tag mode move the head to the tag before build
+ let config = Config::new(&config_path).ok_or("config not found".to_string())?;
+ if let Some(u) = config.update {
+ if u.as_str() == "tagged" {
+ util::pull_latest_tag(&clone_path)
+ .map_err(|e| format!("failed to update repo: {e}"))?;
+ }
+ }
+
if util::yn_prompt("Run build and install commands?") {
println!("Building...");
config::run_config_command(&config_path, &clone_path, ConfigCommand::Build)?;