mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Improve output after initialization
This commit is contained in:
parent
6d1d42d2dd
commit
8bf8b19a5d
1 changed files with 7 additions and 5 deletions
12
src/init.rs
12
src/init.rs
|
@ -1,4 +1,5 @@
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{bail, Context, Result};
|
||||||
|
use crossterm::style::Stylize;
|
||||||
use std::{
|
use std::{
|
||||||
env::set_current_dir,
|
env::set_current_dir,
|
||||||
fs::{self, create_dir},
|
fs::{self, create_dir},
|
||||||
|
@ -58,7 +59,11 @@ pub fn init() -> Result<()> {
|
||||||
.stderr(Stdio::null())
|
.stderr(Stdio::null())
|
||||||
.status();
|
.status();
|
||||||
|
|
||||||
println!("{POST_INIT_MSG}");
|
println!(
|
||||||
|
"\n{}\n\n{}",
|
||||||
|
"Initialization done ✓".green(),
|
||||||
|
POST_INIT_MSG.bold(),
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -84,8 +89,5 @@ You probably already initialized Rustlings.
|
||||||
Run `cd rustlings`
|
Run `cd rustlings`
|
||||||
Then run `rustlings` again";
|
Then run `rustlings` again";
|
||||||
|
|
||||||
const POST_INIT_MSG: &str = "
|
const POST_INIT_MSG: &str = "Run `cd rustlings` to go into the generated directory.
|
||||||
Done initialization!
|
|
||||||
|
|
||||||
Run `cd rustlings` to go into the generated directory.
|
|
||||||
Then run `rustlings` to get started.";
|
Then run `rustlings` to get started.";
|
||||||
|
|
Loading…
Reference in a new issue