simple-git
Version:
Simple GIT interface for node.js
41 lines • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const task_1 = require("./task");
const GetRemoteSummary_1 = require("../responses/GetRemoteSummary");
function addRemoteTask(remoteName, remoteRepo, customArgs = []) {
return task_1.straightThroughStringTask(['remote', 'add', ...customArgs, remoteName, remoteRepo]);
}
exports.addRemoteTask = addRemoteTask;
function getRemotesTask(verbose) {
const commands = ['remote'];
if (verbose) {
commands.push('-v');
}
return {
commands,
format: 'utf-8',
parser: verbose ? GetRemoteSummary_1.parseGetRemotesVerbose : GetRemoteSummary_1.parseGetRemotes,
};
}
exports.getRemotesTask = getRemotesTask;
function listRemotesTask(customArgs = []) {
const commands = [...customArgs];
if (commands[0] !== 'ls-remote') {
commands.unshift('ls-remote');
}
return task_1.straightThroughStringTask(commands);
}
exports.listRemotesTask = listRemotesTask;
function remoteTask(customArgs = []) {
const commands = [...customArgs];
if (commands[0] !== 'remote') {
commands.unshift('remote');
}
return task_1.straightThroughStringTask(commands);
}
exports.remoteTask = remoteTask;
function removeRemoteTask(remoteName) {
return task_1.straightThroughStringTask(['remote', 'remove', remoteName]);
}
exports.removeRemoteTask = removeRemoteTask;
//# sourceMappingURL=remote.js.map