Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ pub fn init() -> Result<()> {
fs::write(".gitignore", GITIGNORE)
.context("Failed to create the file `rustlings/.gitignore`")?;

fs::write("README.md", README).context("Failed to create the file `rustlings/README.md`")?;

create_dir(".vscode").context("Failed to create the directory `rustlings/.vscode`")?;
fs::write(".vscode/extensions.json", VS_CODE_EXTENSIONS_JSON)
.context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
Expand Down Expand Up @@ -220,6 +222,14 @@ target/
.vscode/
";

const README: &[u8] = b"# Rustlings

This is your space to solve Rustlings exercises.
Simply run `rustlings` in this directory to get started!
Learn more about using Rustlings here:
<https://rustlings.rust-lang.org/usage/>
";

pub const VS_CODE_EXTENSIONS_JSON: &[u8] = br#"{"recommendations":["rust-lang.rust-analyzer"]}"#;

const IN_INITIALIZED_DIR_ERR: &str = "It looks like Rustlings is already initialized in this directory.
Expand Down