mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-10 13:10:40 +00:00
Add .gitignore
This commit is contained in:
parent
1e1f031713
commit
b711dd692a
11
src/init.rs
11
src/init.rs
@ -32,6 +32,15 @@ publish = false
|
|||||||
.write_all(&cargo_toml)
|
.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<()> {
|
fn create_vscode_dir() -> Result<()> {
|
||||||
create_dir(".vscode").context("Failed to create the directory `.vscode`")?;
|
create_dir(".vscode").context("Failed to create the directory `.vscode`")?;
|
||||||
let vs_code_extensions_json = br#"{"recommendations":["rust-lang.rust-analyzer"]}"#;
|
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_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`")?;
|
create_vscode_dir().context("Failed to create the file `rustlings/.vscode/extensions.json`")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user