Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Branch Selection for coffee_install() #242

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions coffee_cmd/src/coffee_term/command_show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn show_list(coffee_list: Result<CoffeeList, CoffeeError>) -> Result<(), Cof
term::format::bold(String::from("Language")),
term::format::bold(String::from("Name")),
term::format::bold(String::from("Enabled")),
term::format::bold(String::from("Git HEAD")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a user need also a git PHD to understand what is a git HEAD? Idk if this is necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already print the git HEAD to the user with coffee remote list
If we add the possibility to manage the branch for the plugin in separation from the repository, I think we have to print it in coffee list

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please call it commit there is no meaning to complicate a simple things with big words.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Do you want me to rename "Git HEAD" to "commit" in coffee remote list output too?

term::format::bold(String::from("Exec path")),
]);
table.divider();
Expand All @@ -30,6 +31,8 @@ pub fn show_list(coffee_list: Result<CoffeeList, CoffeeError>) -> Result<(), Cof
// Get whether the plugin is enabled
// If enabled is None, it means the plugin is enabled by default for backward compatibility.
let enabled = plugin.enabled.unwrap_or(true);
let mut commit = plugin.commit.clone().unwrap_or_default();
commit = commit.chars().take(7).collect::<String>();
table.push([
term::format::positive("●").into(),
term::format::highlight(plugin.lang.to_string()),
Expand All @@ -39,6 +42,7 @@ pub fn show_list(coffee_list: Result<CoffeeList, CoffeeError>) -> Result<(), Cof
} else {
term::format::negative("no").into()
},
term::format::primary(commit),
term::format::highlight(plugin.exec_path.to_owned()),
])
}
Expand Down