From 62892b1584a97b324aca2987fd6c0cd8b315df90 Mon Sep 17 00:00:00 2001 From: Steve Lacy Date: Tue, 13 Oct 2015 09:46:40 -0700 Subject: [PATCH] add git clone example with destination - #95 --- README.md | 12 ++++++++++++ examples/gulpfile.js | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 1f57866..2887ff1 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,12 @@ gulp.task('clone', function(){ }); }); +// Clone remote repo to sub folder ($CWD/sub/folder/git-test) +gulp.task('clonesub', function() { + git.clone('https://github.com/stevelacy/git-test', {args: './sub/folder'}, function(err) { + // handle err + }); +}); // Tag the repo with a version gulp.task('tag', function(){ @@ -286,6 +292,12 @@ git.clone('https://remote.git', function (err) { //if (err) ... }); ``` +A desination folder or subfolder can be set with `args: ''` +``` +git.clone('https://remote.git', {args: './sub/folder'} function (err) { + //if (err) ... +}); +``` ### git.add(opt) `git add ` diff --git a/examples/gulpfile.js b/examples/gulpfile.js index 1e0cdff..5b37cb6 100644 --- a/examples/gulpfile.js +++ b/examples/gulpfile.js @@ -46,6 +46,20 @@ gulp.task('commitmulti', function(){ .pipe(git.commit(['initial commit', 'additional message'])); }); +// Clone remote repo to current directory ($CWD/git-test) +gulp.task('clone', function() { + git.clone('https://github.com/stevelacy/git-test', function(err) { + // handle err + }); +}); + +// Clone remote repo to sub folder ($CWD/sub/folder/git-test) +gulp.task('clonesub', function() { + git.clone('https://github.com/stevelacy/git-test', {args: './sub/folder'}, function(err) { + // handle err + }); +}); + // Add remote gulp.task('remote', function(){