Skip to content

Commit 6173c22

Browse files
core: allow to install a branch
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 8170661 commit 6173c22

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

coffee_core/src/coffee.rs

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use serde_json::json;
1515
use tokio::process::Command;
1616

1717
use coffee_github::repository::Github;
18+
use coffee_github::utils::git_checkout;
1819
use coffee_lib::errors::CoffeeError;
1920
use coffee_lib::plugin_manager::PluginManager;
2021
use coffee_lib::repository::Repository;
@@ -316,6 +317,10 @@ impl PluginManager for CoffeeManager {
316317
plugin.root_path = new_root_path;
317318
plugin.exec_path = new_exec_path;
318319

320+
if let Some(branch) = branch {
321+
let _ = git_checkout(&plugin.root_path, &branch, verbose).await?;
322+
}
323+
319324
log::debug!("plugin: {:?}", plugin);
320325
let path = plugin.configure(verbose).await?;
321326
log::debug!("runnable plugin path {path}");

coffee_github/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Github repository implementation
22
33
pub mod repository;
4-
mod utils;
4+
pub mod utils;
55

66
#[cfg(test)]
77
mod tests {

0 commit comments

Comments
 (0)