Skip to content

Instantly share code, notes, and snippets.

@nerevar
Last active August 29, 2015 13:57
Show Gist options
  • Save nerevar/9919589 to your computer and use it in GitHub Desktop.
Save nerevar/9919589 to your computer and use it in GitHub Desktop.
С GNUMakefile на Gulp
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);
}
}
};
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(
'git@github.com: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