Last active
August 29, 2015 14:07
-
-
Save vnys/c61df2c99d0fc1668a92 to your computer and use it in GitHub Desktop.
Get latest arena files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var git = require('git-tools'); | |
var tap = require('gulp-tap'); | |
var path = require('path'); | |
var del = require('del'); | |
var Promise = require('es6-promise').Promise; | |
var latest = ''; | |
gulp.task('arena', ['get:arenaversion'], function () { | |
return gulp.src(path.join('./tmp/castor/sets/arena', latest, '**/*')) | |
.pipe(gulp.dest(path.join('app/arena', latest))); | |
}); | |
gulp.task('get:arenaversion', ['clone:castor'], function () { | |
return gulp.src('./tmp/castor/src/arena/.semver') | |
.pipe(tap(function(file) { | |
latest = file.contents.toString(); | |
})); | |
}); | |
gulp.task('clone:castor', ['clean:tmp'], function(){ | |
return new Promise(function(resolve, reject) { | |
git.clone({ | |
repo: 'ssh://[email protected]/amedia/castor', | |
dir: 'tmp/castor' | |
}, function(error, repo) { | |
if (error) { | |
reject(error) | |
} else { | |
resolve(repo) | |
} | |
}) | |
}); | |
}); | |
gulp.task('clean:tmp', function(cb) { | |
del([ | |
'tmp/**' | |
], cb); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"del": "^0.1.3", | |
"es6-promise": "^1.0.0", | |
"git-tools": "^0.1.1", | |
"gulp": "~3.8.7", | |
"gulp-tap": "^0.1.3", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment