Skip to content

Commit

Permalink
fix(Plugins): Print message when no plugins are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Mar 28, 2021
1 parent bdc004b commit b7535b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rust/src/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,17 @@ pub fn read_plugins() -> Result<Vec<Plugin>> {
/// Create a Markdown table of all the install plugins
pub fn display_plugins() -> Result<String> {
let plugins = read_plugins()?;

if plugins.is_empty() {
return Ok("No plugins installed. See `stencila plugins install --help`.".to_string());
}

let head = r#"
| ---- | ------- | ------------ |
| Name | Version | Description |
| :--- | ------: | -------------|"#;
| :--- | ------: | -------------|
"#
.trim();
let body = plugins
.iter()
.map(|plugin| {
Expand Down

0 comments on commit b7535b2

Please sign in to comment.