Skip to content

Commit

Permalink
Update main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
czy-29 committed Jul 6, 2024
1 parent 6fa18d6 commit 7b410b8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflow-bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use clap::Parser;
use pushover_rs::{send_pushover_request, PushoverSound};
use std::env;
use std::{env, time::Duration};
use tokio::time::sleep;

#[derive(Parser, Debug)]
enum Commands {
Start,
Ok,
Err,
Run,
}

struct Pushover {
Expand Down Expand Up @@ -41,8 +41,15 @@ async fn main() -> Result<(), anyhow::Error> {

match Commands::parse() {
Commands::Start => pushover.send("Workflow开始执行!", PushoverSound::BIKE),
Commands::Ok => pushover.send("Workflow执行成功!", PushoverSound::MAGIC),
Commands::Err => pushover.send("Workflow执行失败!", PushoverSound::FALLING),
Commands::Run => {
sleep(Duration::from_secs(3)).await;

if true {
pushover.send("Workflow执行成功!", PushoverSound::MAGIC)
} else {
pushover.send("Workflow执行失败!", PushoverSound::FALLING)
}
}
}
.await
}

0 comments on commit 7b410b8

Please sign in to comment.