Skip to content

Commit

Permalink
core: allow to install a branch
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Apr 14, 2024
1 parent 8170661 commit 6173c22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions coffee_core/src/coffee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use serde_json::json;
use tokio::process::Command;

use coffee_github::repository::Github;
use coffee_github::utils::git_checkout;
use coffee_lib::errors::CoffeeError;
use coffee_lib::plugin_manager::PluginManager;
use coffee_lib::repository::Repository;
Expand Down Expand Up @@ -316,6 +317,10 @@ impl PluginManager for CoffeeManager {
plugin.root_path = new_root_path;
plugin.exec_path = new_exec_path;

if let Some(branch) = branch {
let _ = git_checkout(&plugin.root_path, &branch, verbose).await?;
}

log::debug!("plugin: {:?}", plugin);
let path = plugin.configure(verbose).await?;
log::debug!("runnable plugin path {path}");
Expand Down
2 changes: 1 addition & 1 deletion coffee_github/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Github repository implementation

pub mod repository;
mod utils;
pub mod utils;

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit 6173c22

Please sign in to comment.