-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
576f70c
commit f3459a4
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "haki" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Dave", "Henrique"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use std::io; | ||
use std::num::ParseIntError; | ||
|
||
fn main() { | ||
let mut parsed_input: Result<u32, ParseIntError>; | ||
|
||
print_options(); | ||
|
||
while { | ||
let mut input = String::new(); | ||
io::stdin().read_line(&mut input).expect("Failed to read line"); | ||
|
||
parsed_input = input.trim().parse(); | ||
let parsed_input_clone = parsed_input.clone(); | ||
|
||
parsed_input.is_err() || !(1..=10).contains(&parsed_input_clone.unwrap()) | ||
} { | ||
println!("Invalid input. Please enter a valid number between 1 and 10:"); | ||
print_options(); | ||
} | ||
|
||
match parsed_input.unwrap() { | ||
1 => install_pinia(), | ||
2 => install_husky(), | ||
3 => install_jenkins(), | ||
4 => install_jotai(), | ||
_ => unreachable!(), | ||
} | ||
} | ||
|
||
fn print_options() { | ||
println!("What do you want to install?"); | ||
println!("1 - Pinia"); | ||
println!("2 - Husky"); | ||
println!("3 - Jenkins"); | ||
println!("4 - Jotai"); | ||
} | ||
|
||
fn install_pinia() { | ||
println!("Installing Pinia..."); | ||
} | ||
|
||
fn install_husky() { | ||
println!("Installing Husky..."); | ||
} | ||
|
||
fn install_jenkins() { | ||
println!("Installing Jenkins..."); | ||
} | ||
|
||
fn install_jotai() { | ||
println!("Installing Jotai..."); | ||
} |