mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Add .gitignore
This commit is contained in:
parent
1e1f031713
commit
b711dd692a
1 changed files with 11 additions and 0 deletions
11
src/init.rs
11
src/init.rs
|
@ -32,6 +32,15 @@ publish = false
|
|||
.write_all(&cargo_toml)
|
||||
}
|
||||
|
||||
fn create_gitignore() -> io::Result<()> {
|
||||
let gitignore = b"/target";
|
||||
OpenOptions::new()
|
||||
.create_new(true)
|
||||
.write(true)
|
||||
.open(".gitignore")?
|
||||
.write_all(gitignore)
|
||||
}
|
||||
|
||||
fn create_vscode_dir() -> Result<()> {
|
||||
create_dir(".vscode").context("Failed to create the directory `.vscode`")?;
|
||||
let vs_code_extensions_json = br#"{"recommendations":["rust-lang.rust-analyzer"]}"#;
|
||||
|
@ -77,6 +86,8 @@ Then run `rustlings` again"
|
|||
|
||||
create_cargo_toml(exercises).context("Failed to create the file `rustlings/Cargo.toml`")?;
|
||||
|
||||
create_gitignore().context("Failed to create the file `rustlings/.gitignore`")?;
|
||||
|
||||
create_vscode_dir().context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue