Skip to content

Commit 0e72c28

Browse files
committed
Merge pull request #8 from qw3rtman/extend-clone-capabilities
Added easy GitHub cloning.
2 parents 6804dfc + a40aba0 commit 0e72c28

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bin/gg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ switch (cli.command) {
2020
case 'cl':
2121
case 'clone':
2222
var repository = cli.args[0];
23-
gg.clone(repository);
23+
24+
if (repository.substring(0, 7) == 'http://') { // URL.
25+
gg.cloneURL(repository);
26+
} else {
27+
gg.cloneGitHub(repository);
28+
}
2429
break;
2530

2631
// Add.

lib/gg.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports.init = function() {
1717
});
1818
};
1919

20-
exports.clone = function(repository) {
20+
exports.cloneURL = function(repository) {
2121
// Nothing to clone.
2222
if (!repository) {
2323
console.log(notice('[~] You must enter a repository URL.'));
@@ -40,6 +40,10 @@ exports.clone = function(repository) {
4040
}
4141
};
4242

43+
exports.cloneGitHub = function(repository) {
44+
exports.cloneURL('https://github.com/' + repository + '.git');
45+
}
46+
4347
exports.addAll = function() {
4448
exec('git add -A');
4549

0 commit comments

Comments
 (0)