update gitignore file in init_exercise.py
Now it will include `target` compiled files as well.
@@ -112,7 +112,13 @@ def make_exercise(name, use_maplit):
# blank out the default lib.rs
with inside(exercise_dir):
with open('.gitignore', 'w') as gitignore:
- print("# Ignore Cargo.lock if creating a library", file=gitignore)
+ with open('.gitignore', 'w') as gitignore:
+ print("# Generated by Cargo", file=gitignore)
+ print("# will have compiled files and executables", file=gitignore)
+ print("/target/", file=gitignore)
+ print("**/*.rs.bk", file=gitignore)
+ print("", file=gitignore)
+ print("# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries", file=gitignore)
print("# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock", file=gitignore)
print("Cargo.lock", file=gitignore)
with open(os.path.join('src', 'lib.rs'), 'w') as lib_rs:
