Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bin/gg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ switch (cli.command) {
case 'cl':
case 'clone':
var repository = cli.args[0];
gg.clone(repository);

if (repository.substring(0, 7) == 'http://') { // URL.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about via ssh ala [email protected]:<username>/<repo>.git?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to do that currently with gg cl [email protected]:<username>/<repo>.git.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qw3rtman Wouldn't this change wrap the SSH form too, e.g. https://github.com/[email protected]:<username>/<repo>.git.git, since it seems to make that decision based solely on not detecting an http:// prefix? Also, what about https:// prefixed input, won't it not see http:// and so wrap that as well?

gg.cloneURL(repository);
} else {
gg.cloneGitHub(repository);
}
break;

// Add.
Expand Down
6 changes: 5 additions & 1 deletion lib/gg.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports.init = function() {
});
};

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

exports.cloneGitHub = function(repository) {
exports.cloneURL('https://github.com/' + repository + '.git');
}

exports.addAll = function() {
exec('git add -A');

Expand Down