Permalink
Browse files

Remove the workspace and recreate it before checking out

That will prevent leftover files
  • Loading branch information...
1 parent 33a0ed2 commit e888de0843b563c7a1f8b605275f62b4ced1c225 @gseguin committed Aug 8, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/project.js
View
6 lib/project.js
@@ -42,6 +42,9 @@ function checkout( project, force, callback ){
if ( exists || force ) {
async.waterfall([
function( next ) {
+ rimraf( path.join( workDir ), next );
+ },
+ function( next ) {
fs.mkdir( workDir, function( err ) {
if ( err && err.code != "EEXIST" ) {
next( err );
@@ -56,9 +59,6 @@ function checkout( project, force, callback ){
function( dir, next ) {
Git( dir, workDir );
Git.exec( [ "checkout", "-f", project.getRef() ], next );
- },
- function( out, next ) {
- project.cleanup( next );
}
], callback );
} else {

0 comments on commit e888de0

Please sign in to comment.