Only gist on failures

This commit is contained in:
Graham Christensen 2017-12-04 19:13:34 -05:00
parent 1fc075a5b7
commit 55c9d50706
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -270,17 +270,14 @@ 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(),
@ -290,15 +287,18 @@ impl worker::SimpleWorker for MassRebuildWorker {
}
);
let gist_url = gists.create(
gist_url = Some(gists.create(
&hubcaps::gists::GistOptions {
description: Some(format!("{:?}", state)),
public: Some(true),
files: files,
}
).expect("Failed to create gist!").html_url;
).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 {