Skip to content

Commit

Permalink
auto merge of rust-lang#321 : alexcrichton/cargo/issue-304, r=wycats
Browse files Browse the repository at this point in the history
The lockfile should only be checked in for bins, not libs.

Closes rust-lang#304
  • Loading branch information
bors committed Aug 6, 2014
2 parents 6ebaa38 + 9ef7490 commit 65acd4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ fn mk(path: &Path, name: &str, opts: &NewOptions) -> CargoResult<()> {

if opts.git {
try!(git!("init", path));
try!(File::create(&path.join(".gitignore")).write(b"/target\n"));
let mut gitignore = "/target\n".to_string();
if !opts.bin {
gitignore.push_str("/Cargo.lock\n");
}
try!(File::create(&path.join(".gitignore")).write(gitignore.as_bytes()));
} else {
try!(fs::mkdir(path, io::UserRWX));
}
Expand Down

0 comments on commit 65acd4d

Please sign in to comment.