Skip to content

Commit

Permalink
feat(src): implement services in binary
Browse files Browse the repository at this point in the history
  • Loading branch information
luchosr committed Jan 6, 2025
1 parent 537fe71 commit e26520f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
use std::env;
pub mod services;
use services::rustacean_author::RustaceanMember;

use anyhow::{bail, Context, Result};

#[tokio::main]
async fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();
let pr_author = args.get(1).context("PR Author is required")?;
let pr_number = args.get(2).context("PR Number is required")?;

if pr_author.is_empty() {
bail!("PR Author Cannot Be Empty!");
}

println!("Hello {pr_author}!");
let rustacean = RustaceanMember::new(pr_author.to_string(), pr_number.to_string());

let rustacean_valid =
services::rustacean_author::RustaceanMember::is_rustacean_valid(&rustacean).await?;

println!("Hello {pr_author} your PR number is {pr_number}, and you are {rustacean_valid}");

Ok(())
}
1 change: 1 addition & 0 deletions src/services/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod rustacean_author;

0 comments on commit e26520f

Please sign in to comment.