Skip to content

Commit

Permalink
fix: Playbook::id() -> Playbook::id
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Jan 15, 2024
1 parent 9973e9f commit f16a788
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "amp"
description = "Amphitheatre's official command line tool"
version = "0.6.0"
version = "0.6.1"
edition = "2021"
license = "Apache-2.0"
homepage = "https://amphitheatre.app"
Expand All @@ -12,8 +12,8 @@ readme = "README.md"

[dependencies]

amp-client = { git = "https://github.com/amphitheatre-app/amp-client-rust", tag = "v0.7.0" }
amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.7.0" }
amp-client = { git = "https://github.com/amphitheatre-app/amp-client-rust", tag = "v0.7.1" }
amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.7.1" }

anyhow = "1.0.79"
clap = { version = "4.4.12", features = ["derive", "env"] }
Expand Down
5 changes: 2 additions & 3 deletions src/cmd/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ impl Cli {
}

for playbook in playbooks {
delete(&ctx.client, &playbook.id()).await?;
delete(&ctx.client, &playbook.id).await?;
}

return Ok(());
}

// create a options list for the user to select from
let options: Vec<OptionItem> =
playbooks.iter().map(|p| OptionItem(p.id().to_string(), p.title.clone())).collect();
let options: Vec<OptionItem> = playbooks.iter().map(|p| OptionItem(p.id.clone(), p.title.clone())).collect();
let answer = Select::new("Select playbook to delete: ", options).prompt().map_err(Errors::InquireError)?;
delete(&ctx.client, answer.0.as_str()).await?;

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub const AFTER_HELP_STRING: &str =
"Use \"amp options\" for a list of global command-line options (applies to all commands).";
pub const DEFAULT_CONFIG_FILEPATH: &str = "~/.config/amphitheatre/config.toml";

/// Amphitheatre's offcial command line tool
/// Amphitheatre's official command line tool
#[derive(Parser, Debug)]
#[command(
arg_required_else_help = true,
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct PlaybookTable {
impl From<&PlaybookSpec> for PlaybookTable {
fn from(value: &PlaybookSpec) -> Self {
Self {
id: value.id().to_string(),
id: value.id.clone(),
title: value.title.clone(),
description: value.description.clone().unwrap_or_default(),
}
Expand Down
4 changes: 2 additions & 2 deletions src/ops/cleaner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub async fn try_cleanup_playbook(ctx: &Arc<Context>) -> Result<()> {
}

// Delete playbook from the server.
let pid = playbook.as_ref().unwrap().id();
let status = ctx.client.playbooks().delete(&pid).map_err(Errors::ClientError)?;
let pid = &playbook.as_ref().unwrap().id;
let status = ctx.client.playbooks().delete(pid).map_err(Errors::ClientError)?;
if status != 204 {
return Err(Errors::FailedDeletePlaybook(pid.to_string()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/ops/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub async fn run(ctx: &Arc<Context>, playbook: PlaybookSpec, options: Options) -
ctx.session.playbook.write().await.replace(playbook.clone());

let character = ctx.session.character.read().await.clone().unwrap();
let pid = Arc::new(playbook.id().to_owned());
let pid = Arc::new(playbook.id.clone());
let name = Arc::new(character.meta.name);

// Initial sync the full sources into the server.
Expand Down

0 comments on commit f16a788

Please sign in to comment.