Skip to content
Open
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
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ getAllRepos(url, auth, function (error, repos) {

// Choose between git and mercurial
var command = repo.scm == 'git' ? 'git' : 'hg';
exec(command + ' clone ' + repo.links.clone[0].href + ' ' + backupFolder + repo.name, callback);
let url = repo.links.clone[0].href;
const urlParts = url.split(/([^@]+)@(.+)/);
if (urlParts.length > 1) {
url = urlParts[1] + ':' + argv.opts.pass + '@' + urlParts[2];
}

exec(command + ' clone ' + (argv.opts.mirror ? '--mirror ' : '') +
url + ' ' + backupFolder + repo.name, callback);
});
});

Expand Down