Skip to content

Commit 8ef4d35

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

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;
@@ -286,6 +287,10 @@ impl PluginManager for CoffeeManager {
286287
plugin.root_path = new_root_path;
287288
plugin.exec_path = new_exec_path;
288289

290+
if let Some(branch) = branch {
291+
let _ = git_checkout(&plugin.root_path, &branch, verbose).await?;
292+
}
293+
289294
log::debug!("plugin: {:?}", plugin);
290295
let path = plugin.configure(verbose).await?;
291296
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)