Skip to content

Commit

Permalink
Only gist on failures
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Dec 5, 2017
1 parent 1fc075a commit 55c9d50
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions ofborg/src/tasks/massrebuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,35 +270,35 @@ impl worker::SimpleWorker for MassRebuildWorker {
status.set(hubcaps::statuses::State::Pending);

let state: hubcaps::statuses::State;
let mut out: File;
let gist_url: Option<String>;
match check.execute(Path::new(&refpath)) {
Ok(o) => {
out = o;
Ok(_) => {
state = hubcaps::statuses::State::Success;
gist_url = None;
}
Err(o) => {
out = o;
Err(mut out) => {
state = hubcaps::statuses::State::Failure;

let mut files = HashMap::new();
files.insert(check.name(),
hubcaps::gists::Content {
filename: Some(check.name()),
content: file_to_str(&mut out),
}
);

gist_url = Some(gists.create(
&hubcaps::gists::GistOptions {
description: Some(format!("{:?}", state)),
public: Some(true),
files: files,
}
).expect("Failed to create gist!").html_url);
}
}

let mut files = HashMap::new();
files.insert(check.name(),
hubcaps::gists::Content {
filename: Some(check.name()),
content: file_to_str(&mut out),
}
);

let gist_url = gists.create(
&hubcaps::gists::GistOptions {
description: Some(format!("{:?}", state)),
public: Some(true),
files: files,
}
).expect("Failed to create gist!").html_url;

status.set_url(Some(gist_url));
status.set_url(gist_url);
status.set(state.clone());

if state == hubcaps::statuses::State::Success {
Expand Down

0 comments on commit 55c9d50

Please sign in to comment.