@smbcloud / cli / commits / 5adaeff

Update receh

Seto Elkahfi committed Apr 8, 2023 at 23:48 UTC 5adaeff78fadf84861ac48e5e0b1430110ae6691
3 files changed +18 -13
README.MD
+10 -5
@@ -2,29 +2,33 @@
2
3 This is a CLI program to access [SmbPndk](https://smbpndk.com/).
4
5 -## Install
5 +## Installation
6
7 One can install this program in different ways.
8
9 -With Cargo:
9 +### With Cargo
10
11 ```bash
12 cargo install smbpndk-cli
13 ```
14
15 -Homebrew (MacOS):
15 +### Homebrew (MacOS/Linux)
16
17 ```bash
18 brew tap smbpndk/tap
19 brew install cli
20 ```
21
22 -With NPM
22 +### With NPM
23
24 ```
25 npm i -g @smbpndk/cli
26 ```
27
28 +## Update
29 +
30 +Simply rerun the installation command.
31 +
32 ## Uninstall
33
34 ```bash
@@ -40,7 +44,7 @@ brew untap smbpndk/tap
44 brew uninstall smbpndk/tap/cli
45 ```
46
43 -Usage:
47 +## Usage:
48
49 ```bash
50 smb --help
@@ -50,6 +54,7 @@ smb --help
54
55 - Setup your Rust tooling.
56 - Clone the repo.
57 +- Provide the environement variables in the .env.local.
58 - Run `cargo run`.
59
60 ## Credits
src/account/signup/process.rs
+6 -6
@@ -81,7 +81,7 @@ pub async fn signup_with_email(email: Option<String>) -> Result<CommandResult> {
81 {
82 Ok(_) => Ok(CommandResult {
83 spinner,
84 - symbol: style("✔".to_string()).for_stderr().green().to_string(),
84 + symbol: style("✅".to_string()).for_stderr().green().to_string(),
85 msg: "You are signed up! Check your email to confirm your account.".to_owned(),
86 }),
87 Err(e) => Ok(CommandResult {
@@ -98,7 +98,7 @@ pub async fn signup_with_github() -> Result<CommandResult> {
98 // Open the GitHub OAuth URL in the user's browser
99 let mut spinner = Spinner::new(
100 spinners::Spinners::BouncingBall,
101 - style("Getting your GitHub information...")
101 + style("🚀 Getting your GitHub information...")
102 .green()
103 .bold()
104 .to_string(),
@@ -218,14 +218,14 @@ async fn process_signup_github(code: String) -> Result<CommandResult> {
218 .await?;
219 let mut spinner = Spinner::new(
220 spinners::Spinners::BouncingBall,
221 - style("Requesting GitHub token...")
221 + style("🚀 Requesting GitHub token...")
222 .green()
223 .bold()
224 .to_string(),
225 );
226 match response.status() {
227 StatusCode::OK => {
228 - spinner.stop_and_persist("✔", "Finished requesting GitHub token!".into());
228 + spinner.stop_and_persist("✅", "Finished requesting GitHub token!".into());
229 debug!("Response: {:#?}", &response);
230 let result: GithubToken = response.json().await?;
231 debug!("Result: {:#?}", &result);
@@ -242,7 +242,7 @@ async fn process_signup_github(code: String) -> Result<CommandResult> {
242 async fn get_github_data(token: String) -> Result<CommandResult> {
243 let mut spinner = Spinner::new(
244 spinners::Spinners::BouncingBall,
245 - style("Requesting GitHub data...")
245 + style("🚀 Requesting GitHub data...")
246 .green()
247 .bold()
248 .to_string(),
@@ -259,7 +259,7 @@ async fn get_github_data(token: String) -> Result<CommandResult> {
259
260 match response.status() {
261 StatusCode::OK => {
262 - spinner.stop_and_persist("✔", "Finished requesting GitHub token!".into());
262 + spinner.stop_and_persist("✅", "Finished requesting GitHub data!".into());
263 debug!("Response: {:#?}", &response);
264 let mut emails: Vec<GithubEmail> = response.json().await?;
265 debug!(&emails);
src/main.rs
+2 -2
@@ -100,7 +100,7 @@ async fn run() -> Result<CommandResult> {
100
101 let spinner = Spinner::new(
102 spinners::Spinners::SimpleDotsScrolling,
103 - style("Logging in...").green().bold().to_string(),
103 + style("⏳ Logging in...").green().bold().to_string(),
104 );
105
106 match process_login(LoginArgs { username, password }).await {
@@ -111,7 +111,7 @@ async fn run() -> Result<CommandResult> {
111 }),
112 Err(e) => Ok(CommandResult {
113 spinner,
114 - symbol: "❌".to_owned(),
114 + symbol: "😩".to_owned(),
115 msg: format!("Failed to login: {e}"),
116 }),
117 }