Last active
August 29, 2015 13:57
-
-
Save nerevar/9919589 to your computer and use it in GitHub Desktop.
С GNUMakefile на Gulp
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 shell = require('shelljs'); | |
module.exports = { | |
clone: function(repo, path, state) { | |
shell.exec('mkdir -p ' + path); | |
shell.exec('cd ' + path); | |
shell.exec('git init .'); | |
shell.exec('git config remote.origin.url "' + repo + '"'); | |
shell.exec('git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"'); | |
shell.exec('git fetch origin'); | |
shell.exec('git fetch --tags'); | |
shell.exec('git checkout -f develop'); | |
shell.exec('git checkout -f ' + state); | |
// если есть удалённая ветка — стягиваем | |
if (shell.exec('git show-ref refs/remotes/origin/' + state).output) { | |
shell.exec('git pull --rebase origin ' + state); | |
} | |
} | |
}; |
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'), | |
shell = require('shelljs'), | |
bower = require('gulp-bower'), | |
git = require('gulp-gitter'); | |
gulp.task('libs', function(cb) { | |
return bower() | |
.pipe(gulp.dest('libs/')); | |
}); | |
gulp.task('sakhalin', function(cb) { | |
git.clone( | |
'[email protected]:org/repo.git', | |
'repo', | |
'develop', | |
function(err, repo) { | |
if (err) { | |
cb(err); | |
return; | |
} | |
} | |
); | |
cb(); | |
}); | |
gulp.task('build', function(cb) { | |
shell.exec('enb make'); | |
cb(); | |
}); | |
gulp.task('default', ['build']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment