Skip to content

Fixes glacier command #580

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

Merged
merged 2 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions Cargo.lock

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

6 changes: 2 additions & 4 deletions parser/src/command/glacier.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
//! The glacier command parser.
//!
//! This adds the option to track ICEs. Do note that the gist must be from a playground link.
//! The link must also be in quotes.
//! This adds the option to track ICEs. The <code-source> must be in quotes.
//!
//! The grammar is as follows:
//!
//! ```text
//! Command: `@bot glacier <code-source>`
//!
//! <code-source>:
//! - "https://gist.github.com/.*"
//! <code-source>: any URL that resolves to plain-text Rust code
//! ```

use crate::error::Error;
Expand Down
3 changes: 1 addition & 2 deletions src/handlers/glacier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ async fn handle_input(ctx: &Context, event: &Event, cmd: GlacierCommand) -> anyh
return Ok(())
};

let url = cmd.source;
let response = ctx.github.raw().get(&format!("{}{}", url.replace("github", "githubusercontent"), "/playground.rs")).send().await?;
let response = ctx.github.raw().get(&cmd.source).send().await?;
let body = response.text().await?;

let number = event.issue().unwrap().number;
Expand Down