simple git installed
This commit is contained in:
1 parent
e2a8f4be8e
commit
f2e744cb7e
276 files changed
+11110
-1
No files matched your search
+3
@@ -0,0 +1,3 @@
|
||||
import { OptionFlags, Options, StringTask } from '../types';
|
||||
export declare type ApplyOptions = Options & OptionFlags<'--stat' | '--numstat' | '--summary' | '--check' | '--index' | '--intent-to-add' | '--3way' | '--apply' | '--no-add' | '-R' | '--reverse' | '--allow-binary-replacement' | '--binary' | '--reject' | '-z' | '--inaccurate-eof' | '--recount' | '--cached' | '--ignore-space-change' | '--ignore-whitespace' | '--verbose' | '--unsafe-paths'> & OptionFlags<'--whitespace', 'nowarn' | 'warn' | 'fix' | 'error' | 'error-all'> & OptionFlags<'--build-fake-ancestor' | '--exclude' | '--include' | '--directory', string> & OptionFlags<'-p' | '-C', number>;
|
||||
export declare function applyPatchTask(patches: string[], customArgs: string[]): StringTask<string>;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applyPatchTask = void 0;
|
||||
const task_1 = require("./task");
|
||||
function applyPatchTask(patches, customArgs) {
|
||||
return task_1.straightThroughStringTask(['apply', ...customArgs, ...patches]);
|
||||
}
|
||||
exports.applyPatchTask = applyPatchTask;
|
||||
//# sourceMappingURL=apply-patch.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"apply-patch.js","sourceRoot":"","sources":["apply-patch.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAkCnD,SAAgB,cAAc,CAAC,OAAiB,EAAE,UAAoB;IACnE,OAAO,gCAAyB,CAAC,CAAC,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,wCAEC"}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { BranchMultiDeleteResult, BranchSingleDeleteResult, BranchSummary } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function containsDeleteBranchCommand(commands: string[]): boolean;
|
||||
export declare function branchTask(customArgs: string[]): StringTask<BranchSummary | BranchSingleDeleteResult>;
|
||||
export declare function branchLocalTask(): StringTask<BranchSummary>;
|
||||
export declare function deleteBranchesTask(branches: string[], forceDelete?: boolean): StringTask<BranchMultiDeleteResult>;
|
||||
export declare function deleteBranchTask(branch: string, forceDelete?: boolean): StringTask<BranchSingleDeleteResult>;
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deleteBranchTask = exports.deleteBranchesTask = exports.branchLocalTask = exports.branchTask = exports.containsDeleteBranchCommand = void 0;
|
||||
const git_response_error_1 = require("../errors/git-response-error");
|
||||
const parse_branch_delete_1 = require("../parsers/parse-branch-delete");
|
||||
const parse_branch_1 = require("../parsers/parse-branch");
|
||||
function containsDeleteBranchCommand(commands) {
|
||||
const deleteCommands = ['-d', '-D', '--delete'];
|
||||
return commands.some(command => deleteCommands.includes(command));
|
||||
}
|
||||
exports.containsDeleteBranchCommand = containsDeleteBranchCommand;
|
||||
function branchTask(customArgs) {
|
||||
const isDelete = containsDeleteBranchCommand(customArgs);
|
||||
const commands = ['branch', ...customArgs];
|
||||
if (commands.length === 1) {
|
||||
commands.push('-a');
|
||||
}
|
||||
if (!commands.includes('-v')) {
|
||||
commands.splice(1, 0, '-v');
|
||||
}
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands,
|
||||
parser(stdOut, stdErr) {
|
||||
if (isDelete) {
|
||||
return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr).all[0];
|
||||
}
|
||||
return parse_branch_1.parseBranchSummary(stdOut);
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.branchTask = branchTask;
|
||||
function branchLocalTask() {
|
||||
const parser = parse_branch_1.parseBranchSummary;
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['branch', '-v'],
|
||||
parser,
|
||||
};
|
||||
}
|
||||
exports.branchLocalTask = branchLocalTask;
|
||||
function deleteBranchesTask(branches, forceDelete = false) {
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['branch', '-v', forceDelete ? '-D' : '-d', ...branches],
|
||||
parser(stdOut, stdErr) {
|
||||
return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr);
|
||||
},
|
||||
onError(exitCode, error, done, fail) {
|
||||
if (!parse_branch_delete_1.hasBranchDeletionError(error, exitCode)) {
|
||||
return fail(error);
|
||||
}
|
||||
done(error);
|
||||
},
|
||||
concatStdErr: true,
|
||||
};
|
||||
}
|
||||
exports.deleteBranchesTask = deleteBranchesTask;
|
||||
function deleteBranchTask(branch, forceDelete = false) {
|
||||
const task = {
|
||||
format: 'utf-8',
|
||||
commands: ['branch', '-v', forceDelete ? '-D' : '-d', branch],
|
||||
parser(stdOut, stdErr) {
|
||||
return parse_branch_delete_1.parseBranchDeletions(stdOut, stdErr).branches[branch];
|
||||
},
|
||||
onError(exitCode, error, _, fail) {
|
||||
if (!parse_branch_delete_1.hasBranchDeletionError(error, exitCode)) {
|
||||
return fail(error);
|
||||
}
|
||||
throw new git_response_error_1.GitResponseError(task.parser(error, ''), error);
|
||||
},
|
||||
concatStdErr: true,
|
||||
};
|
||||
return task;
|
||||
}
|
||||
exports.deleteBranchTask = deleteBranchTask;
|
||||
//# sourceMappingURL=branch.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"branch.js","sourceRoot":"","sources":["branch.ts"],"names":[],"mappings":";;;AAEA,qEAAgE;AAChE,wEAA8F;AAC9F,0DAA6D;AAE7D,SAAgB,2BAA2B,CAAC,QAAkB;IAC3D,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAChD,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAHD,kEAGC;AAED,SAAgB,UAAU,CAAC,UAAoB;IA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AI,EAAE,IAAI;YAChC,IAAI,CAAC,4CAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;gBAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;aACrB;YAED,IAAI,CAAC,KAAK,CAAC,CAAC;QACf,CAAC;QACD,YAAY,EAAE,IAAI;KACpB,CAAA;AACJ,CAAC;AAhBD,gDAgBC;AAED,SAAgB,gBAAgB,CAAC,MAAc,EAAE,WAAW,GAAG,KAAK;IACjE,MAAM,IAAI,GAAyC;QAChD,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;QAC7D,MAAM,CAAC,MAAM,EAAE,MAAM;YAClB,OAAO,0CAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAC;QACjE,CAAC;QACD,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI;YAC7B,IAAI,CAAC,4CAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;gBAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;aACrB;YAED,MAAM,IAAI,qCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;QACD,YAAY,EAAE,IAAI;KACpB,CAAC;IAEF,OAAO,IAAI,CAAC;AACf,CAAC;AAlBD,4CAkBC"}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { Maybe, StringTask } from '../types';
|
||||
export declare enum CheckRepoActions {
|
||||
BARE = "bare",
|
||||
IN_TREE = "tree",
|
||||
IS_REPO_ROOT = "root"
|
||||
}
|
||||
export declare function checkIsRepoTask(action: Maybe<CheckRepoActions>): StringTask<boolean>;
|
||||
export declare function checkIsRepoRootTask(): StringTask<boolean>;
|
||||
export declare function checkIsBareRepoTask(): StringTask<boolean>;
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.checkIsBareRepoTask = exports.checkIsRepoRootTask = exports.checkIsRepoTask = exports.CheckRepoActions = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
var CheckRepoActions;
|
||||
(function (CheckRepoActions) {
|
||||
CheckRepoActions["BARE"] = "bare";
|
||||
CheckRepoActions["IN_TREE"] = "tree";
|
||||
CheckRepoActions["IS_REPO_ROOT"] = "root";
|
||||
})(CheckRepoActions = exports.CheckRepoActions || (exports.CheckRepoActions = {}));
|
||||
const onError = (exitCode, stdErr, done, fail) => {
|
||||
if (exitCode === utils_1.ExitCodes.UNCLEAN && isNotRepoMessage(stdErr)) {
|
||||
return done('false');
|
||||
}
|
||||
fail(stdErr);
|
||||
};
|
||||
const parser = (text) => {
|
||||
return text.trim() === 'true';
|
||||
};
|
||||
function checkIsRepoTask(action) {
|
||||
switch (action) {
|
||||
case CheckRepoActions.BARE:
|
||||
return checkIsBareRepoTask();
|
||||
case CheckRepoActions.IS_REPO_ROOT:
|
||||
return checkIsRepoRootTask();
|
||||
}
|
||||
const commands = ['rev-parse', '--is-inside-work-tree'];
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
onError,
|
||||
parser,
|
||||
};
|
||||
}
|
||||
exports.checkIsRepoTask = checkIsRepoTask;
|
||||
function checkIsRepoRootTask() {
|
||||
const commands = ['rev-parse', '--git-dir'];
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
onError,
|
||||
parser(path) {
|
||||
return /^\.(git)?$/.test(path.trim());
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.checkIsRepoRootTask = checkIsRepoRootTask;
|
||||
function checkIsBareRepoTask() {
|
||||
const commands = ['rev-parse', '--is-bare-repository'];
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
onError,
|
||||
parser,
|
||||
};
|
||||
}
|
||||
exports.checkIsBareRepoTask = checkIsBareRepoTask;
|
||||
function isNotRepoMessage(message) {
|
||||
return /(Not a git repository|Kein Git-Repository)/i.test(message);
|
||||
}
|
||||
//# sourceMappingURL=check-is-repo.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"check-is-repo.js","sourceRoot":"","sources":["check-is-repo.ts"],"names":[],"mappings":";;;AAAA,oCAAqC;AAGrC,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACzB,iCAAa,CAAA;IACb,oCAAgB,CAAA;IAChB,yCAAqB,CAAA;AACxB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,MAAM,OAAO,GAAmC,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAC9E,IAAI,QAAQ,KAAK,iBAAS,CAAC,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;KACvB;IAED,IAAI,CAAC,MAAM,CAAC,CAAC;AAChB,CAAC,CAAA;AAED,MAAM,MAAM,GAAkC,CAAC,IAAI,EAAE,EAAE;IACpD,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;AACjC,CAAC,CAAA;AAED,SAAgB,eAAe,CAAC,MAA+B;IAC5D,QAAQ,MAAM,EAAE;QACb,KAAK,gBAAgB,CAAC,IAAI;YACvB,OAAO,mBAAmB,EAAE,CAAC;QAChC,KAAK,gBAAgB,CAAC,YAAY;YAC/B,OAAO,mBAAmB,EAAE,CAAC;KAClC;IAED,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;IAExD,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,OAAO;QACP,MAAM;KACR,CAAA;AACJ,CAAC;AAhBD,0CAgBC;AAGD,SAAgB,mBAAmB;IAChC,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAE5C,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,OAAO;QACP,MAAM,CAAC,IAAI;YACR,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;KACH,CAAA;AACJ,CAAC;AAXD,kDAWC;AAGD,SAAgB,mBAAmB;IAChC,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IAEvD,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,OAAO;QACP,MAAM;KACR,CAAA;AACJ,CAAC;AATD,kDASC;AAGD,SAAS,gBAAgB,CAAC,OAAe;IACtC,OAAO,6CAA6C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { CleanSummary } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare const CONFIG_ERROR_INTERACTIVE_MODE = "Git clean interactive mode is not supported";
|
||||
export declare const CONFIG_ERROR_MODE_REQUIRED = "Git clean mode parameter (\"n\" or \"f\") is required";
|
||||
export declare const CONFIG_ERROR_UNKNOWN_OPTION = "Git clean unknown option found in: ";
|
||||
/**
|
||||
* All supported option switches available for use in a `git.clean` operation
|
||||
*/
|
||||
export declare enum CleanOptions {
|
||||
DRY_RUN = "n",
|
||||
FORCE = "f",
|
||||
IGNORED_INCLUDED = "x",
|
||||
IGNORED_ONLY = "X",
|
||||
EXCLUDING = "e",
|
||||
QUIET = "q",
|
||||
RECURSIVE = "d"
|
||||
}
|
||||
/**
|
||||
* The two modes `git.clean` can run in - one of these must be supplied in order
|
||||
* for the command to not throw a `TaskConfigurationError`
|
||||
*/
|
||||
export declare type CleanMode = CleanOptions.FORCE | CleanOptions.DRY_RUN;
|
||||
export declare function cleanWithOptionsTask(mode: CleanMode | string, customArgs: string[]): import("./task").EmptyTask<void> | StringTask<CleanSummary>;
|
||||
export declare function cleanTask(mode: CleanMode, customArgs: string[]): StringTask<CleanSummary>;
|
||||
export declare function isCleanOptionsArray(input: string[]): input is CleanOptions[];
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isCleanOptionsArray = exports.cleanTask = exports.cleanWithOptionsTask = exports.CleanOptions = exports.CONFIG_ERROR_UNKNOWN_OPTION = exports.CONFIG_ERROR_MODE_REQUIRED = exports.CONFIG_ERROR_INTERACTIVE_MODE = void 0;
|
||||
const CleanSummary_1 = require("../responses/CleanSummary");
|
||||
const utils_1 = require("../utils");
|
||||
const task_1 = require("./task");
|
||||
exports.CONFIG_ERROR_INTERACTIVE_MODE = 'Git clean interactive mode is not supported';
|
||||
exports.CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter ("n" or "f") is required';
|
||||
exports.CONFIG_ERROR_UNKNOWN_OPTION = 'Git clean unknown option found in: ';
|
||||
/**
|
||||
* All supported option switches available for use in a `git.clean` operation
|
||||
*/
|
||||
var CleanOptions;
|
||||
(function (CleanOptions) {
|
||||
CleanOptions["DRY_RUN"] = "n";
|
||||
CleanOptions["FORCE"] = "f";
|
||||
CleanOptions["IGNORED_INCLUDED"] = "x";
|
||||
CleanOptions["IGNORED_ONLY"] = "X";
|
||||
CleanOptions["EXCLUDING"] = "e";
|
||||
CleanOptions["QUIET"] = "q";
|
||||
CleanOptions["RECURSIVE"] = "d";
|
||||
})(CleanOptions = exports.CleanOptions || (exports.CleanOptions = {}));
|
||||
const CleanOptionValues = new Set(['i', ...utils_1.asStringArray(Object.values(CleanOptions))]);
|
||||
function cleanWithOptionsTask(mode, customArgs) {
|
||||
const { cleanMode, options, valid } = getCleanOptions(mode);
|
||||
if (!cleanMode) {
|
||||
return task_1.configurationErrorTask(exports.CONFIG_ERROR_MODE_REQUIRED);
|
||||
}
|
||||
if (!valid.options) {
|
||||
return task_1.configurationErrorTask(exports.CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode));
|
||||
}
|
||||
options.push(...customArgs);
|
||||
if (options.some(isInteractiveMode)) {
|
||||
return task_1.configurationErrorTask(exports.CONFIG_ERROR_INTERACTIVE_MODE);
|
||||
}
|
||||
return cleanTask(cleanMode, options);
|
||||
}
|
||||
exports.cleanWithOptionsTask = cleanWithOptionsTask;
|
||||
function cleanTask(mode, customArgs) {
|
||||
const commands = ['clean', `-${mode}`, ...customArgs];
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser(text) {
|
||||
return CleanSummary_1.cleanSummaryParser(mode === CleanOptions.DRY_RUN, text);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.cleanTask = cleanTask;
|
||||
function isCleanOptionsArray(input) {
|
||||
return Array.isArray(input) && input.every(test => CleanOptionValues.has(test));
|
||||
}
|
||||
exports.isCleanOptionsArray = isCleanOptionsArray;
|
||||
function getCleanOptions(input) {
|
||||
let cleanMode;
|
||||
let options = [];
|
||||
let valid = { cleanMode: false, options: true };
|
||||
input.replace(/[^a-z]i/g, '').split('').forEach(char => {
|
||||
if (isCleanMode(char)) {
|
||||
cleanMode = char;
|
||||
valid.cleanMode = true;
|
||||
}
|
||||
else {
|
||||
valid.options = valid.options && isKnownOption(options[options.length] = (`-${char}`));
|
||||
}
|
||||
});
|
||||
return {
|
||||
cleanMode,
|
||||
options,
|
||||
valid,
|
||||
};
|
||||
}
|
||||
function isCleanMode(cleanMode) {
|
||||
return cleanMode === CleanOptions.FORCE || cleanMode === CleanOptions.DRY_RUN;
|
||||
}
|
||||
function isKnownOption(option) {
|
||||
return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1));
|
||||
}
|
||||
function isInteractiveMode(option) {
|
||||
if (/^-[^\-]/.test(option)) {
|
||||
return option.indexOf('i') > 0;
|
||||
}
|
||||
return option === '--interactive';
|
||||
}
|
||||
//# sourceMappingURL=clean.js.map
|
||||
+1
@@ -0,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,CAAC,SAAkB;IACpC,OAAO,SAAS,KAAK,YAAY,CAAC,KAAK,IAAI,SAAS,KAAK,YAAY,CAAC,OAAO,CAAC;AACjF,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACtC,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACjC;IAED,OAAO,MAAM,KAAK,eAAe,CAAC;AACrC,CAAC"}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { OptionFlags, Options, StringTask } from '../types';
|
||||
export declare type CloneOptions = Options & OptionFlags<'--bare' | '--dissociate' | '--mirror' | '--no-checkout' | '--no-remote-submodules' | '--no-shallow-submodules' | '--no-single-branch' | '--no-tags' | '--remote-submodules' | '--single-branch' | '--shallow-submodules' | '--verbose'> & OptionFlags<'--depth' | '-j' | '--jobs', number> & OptionFlags<'--branch' | '--origin' | '--recurse-submodules' | '--separate-git-dir' | '--shallow-exclude' | '--shallow-since' | '--template', string>;
|
||||
export declare function cloneTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): StringTask<string>;
|
||||
export declare function cloneMirrorTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): StringTask<string>;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cloneMirrorTask = exports.cloneTask = void 0;
|
||||
const task_1 = require("./task");
|
||||
const utils_1 = require("../utils");
|
||||
function cloneTask(repo, directory, customArgs) {
|
||||
const commands = ['clone', ...customArgs];
|
||||
if (typeof repo === 'string') {
|
||||
commands.push(repo);
|
||||
}
|
||||
if (typeof directory === 'string') {
|
||||
commands.push(directory);
|
||||
}
|
||||
return task_1.straightThroughStringTask(commands);
|
||||
}
|
||||
exports.cloneTask = cloneTask;
|
||||
function cloneMirrorTask(repo, directory, customArgs) {
|
||||
utils_1.append(customArgs, '--mirror');
|
||||
return cloneTask(repo, directory, customArgs);
|
||||
}
|
||||
exports.cloneMirrorTask = cloneMirrorTask;
|
||||
//# sourceMappingURL=clone.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"clone.js","sourceRoot":"","sources":["clone.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAEnD,oCAAkC;AAoBlC,SAAgB,SAAS,CAAC,IAAwB,EAAE,SAA6B,EAAE,UAAoB;IACpG,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,CAAC;IAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC3B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACtB;IACD,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QAChC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC3B;IAED,OAAO,gCAAyB,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAVD,8BAUC;AAED,SAAgB,eAAe,CAAC,IAAwB,EAAE,SAA6B,EAAE,UAAoB;IAC1G,cAAM,CAAC,UAAU,EAAC,UAAU,CAAC,CAAC;IAE9B,OAAO,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjD,CAAC;AAJD,0CAIC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { CommitResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function commitTask(message: string[], files: string[], customArgs: string[]): StringTask<CommitResult>;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.commitTask = void 0;
|
||||
const parse_commit_1 = require("../parsers/parse-commit");
|
||||
function commitTask(message, files, customArgs) {
|
||||
const commands = ['commit'];
|
||||
message.forEach((m) => commands.push('-m', m));
|
||||
commands.push(...files, ...customArgs);
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser: parse_commit_1.parseCommitResult,
|
||||
};
|
||||
}
|
||||
exports.commitTask = commitTask;
|
||||
//# sourceMappingURL=commit.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"commit.js","sourceRoot":"","sources":["commit.ts"],"names":[],"mappings":";;;AACA,0DAA4D;AAG5D,SAAgB,UAAU,CAAC,OAAiB,EAAE,KAAe,EAAE,UAAoB;IAChF,MAAM,QAAQ,GAAa,CAAC,QAAQ,CAAC,CAAC;IAEtC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/C,QAAQ,CAAC,IAAI,CACV,GAAG,KAAK,EACR,GAAG,UAAU,CACf,CAAC;IAEF,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,gCAAiB;KAC3B,CAAA;AACJ,CAAC;AAfD,gCAeC"}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { ConfigListSummary } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function addConfigTask(key: string, value: string, append?: boolean): StringTask<string>;
|
||||
export declare function listConfigTask(): StringTask<ConfigListSummary>;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.listConfigTask = exports.addConfigTask = void 0;
|
||||
const ConfigList_1 = require("../responses/ConfigList");
|
||||
function addConfigTask(key, value, append = false) {
|
||||
const commands = ['config', '--local'];
|
||||
if (append) {
|
||||
commands.push('--add');
|
||||
}
|
||||
commands.push(key, value);
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser(text) {
|
||||
return text;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.addConfigTask = addConfigTask;
|
||||
function listConfigTask() {
|
||||
return {
|
||||
commands: ['config', '--list', '--show-origin', '--null'],
|
||||
format: 'utf-8',
|
||||
parser(text) {
|
||||
return ConfigList_1.configListParser(text);
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.listConfigTask = listConfigTask;
|
||||
//# sourceMappingURL=config.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"config.js","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":";;;AAEA,wDAA2D;AAE3D,SAAgB,aAAa,CAAC,GAAW,EAAE,KAAa,EAAE,MAAM,GAAG,KAAK;IACrE,MAAM,QAAQ,GAAa,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEjD,IAAI,MAAM,EAAE;QACT,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACzB;IAED,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAE1B,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,IAAY;YAChB,OAAO,IAAI,CAAC;QACf,CAAC;KACH,CAAA;AACJ,CAAC;AAhBD,sCAgBC;AAED,SAAgB,cAAc;IAC3B,OAAO;QACJ,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,CAAC;QACzD,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,IAAY;YAChB,OAAO,6BAAgB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;KACH,CAAA;AACJ,CAAC;AARD,wCAQC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { StringTask } from '../types';
|
||||
import { DiffResult } from '../../../typings';
|
||||
export declare function diffSummaryTask(customArgs: string[]): StringTask<DiffResult>;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.diffSummaryTask = void 0;
|
||||
const parse_diff_summary_1 = require("../parsers/parse-diff-summary");
|
||||
function diffSummaryTask(customArgs) {
|
||||
return {
|
||||
commands: ['diff', '--stat=4096', ...customArgs],
|
||||
format: 'utf-8',
|
||||
parser(stdOut) {
|
||||
return parse_diff_summary_1.parseDiffResult(stdOut);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.diffSummaryTask = diffSummaryTask;
|
||||
//# sourceMappingURL=diff.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"diff.js","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":";;;AAEA,sEAAgE;AAEhE,SAAgB,eAAe,CAAC,UAAoB;IACjD,OAAO;QACJ,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;QAChD,MAAM,EAAE,OAAO;QACf,MAAM,CAAE,MAAM;YACX,OAAO,oCAAe,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;KACH,CAAA;AACJ,CAAC;AARD,0CAQC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { FetchResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function fetchTask(remote: string, branch: string, customArgs: string[]): StringTask<FetchResult>;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fetchTask = void 0;
|
||||
const parse_fetch_1 = require("../parsers/parse-fetch");
|
||||
function fetchTask(remote, branch, customArgs) {
|
||||
const commands = ['fetch', ...customArgs];
|
||||
if (remote && branch) {
|
||||
commands.push(remote, branch);
|
||||
}
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser: parse_fetch_1.parseFetchResult,
|
||||
};
|
||||
}
|
||||
exports.fetchTask = fetchTask;
|
||||
//# sourceMappingURL=fetch.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["fetch.ts"],"names":[],"mappings":";;;AACA,wDAA0D;AAG1D,SAAgB,SAAS,CAAC,MAAc,EAAE,MAAc,EAAE,UAAoB;IAC3E,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,CAAC;IAC1C,IAAI,MAAM,IAAI,MAAM,EAAE;QACnB,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC;IAED,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,8BAAgB;KAC1B,CAAA;AACJ,CAAC;AAXD,8BAWC"}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { StringTask } from '../types';
|
||||
/**
|
||||
* Task used by `git.hashObject`
|
||||
*/
|
||||
export declare function hashObjectTask(filePath: string, write: boolean): StringTask<string>;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hashObjectTask = void 0;
|
||||
const task_1 = require("./task");
|
||||
/**
|
||||
* Task used by `git.hashObject`
|
||||
*/
|
||||
function hashObjectTask(filePath, write) {
|
||||
const commands = ['hash-object', filePath];
|
||||
if (write) {
|
||||
commands.push('-w');
|
||||
}
|
||||
return task_1.straightThroughStringTask(commands, true);
|
||||
}
|
||||
exports.hashObjectTask = hashObjectTask;
|
||||
//# sourceMappingURL=hash-object.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hash-object.js","sourceRoot":"","sources":["hash-object.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAGnD;;GAEG;AACH,SAAgB,cAAc,CAAC,QAAgB,EAAE,KAAc;IAC5D,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC3C,IAAI,KAAK,EAAE;QACR,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,OAAO,gCAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAPD,wCAOC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { InitResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function initTask(bare: boolean | undefined, path: string, customArgs: string[]): StringTask<InitResult>;
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.initTask = void 0;
|
||||
const InitSummary_1 = require("../responses/InitSummary");
|
||||
const bareCommand = '--bare';
|
||||
function hasBareCommand(command) {
|
||||
return command.includes(bareCommand);
|
||||
}
|
||||
function initTask(bare = false, path, customArgs) {
|
||||
const commands = ['init', ...customArgs];
|
||||
if (bare && !hasBareCommand(commands)) {
|
||||
commands.splice(1, 0, bareCommand);
|
||||
}
|
||||
return {
|
||||
commands,
|
||||
concatStdErr: false,
|
||||
format: 'utf-8',
|
||||
parser(text) {
|
||||
return InitSummary_1.parseInit(commands.includes('--bare'), path, text);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.initTask = initTask;
|
||||
//# sourceMappingURL=init.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["init.ts"],"names":[],"mappings":";;;AACA,0DAAqD;AAGrD,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B,SAAS,cAAc,CAAC,OAAiB;IACtC,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,QAAQ,CAAC,IAAI,GAAG,KAAK,EAAE,IAAY,EAAE,UAAoB;IACtE,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;IACzC,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACpC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;KACrC;IAED,OAAO;QACJ,QAAQ;QACR,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,IAAY;YAChB,OAAO,uBAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7D,CAAC;KACH,CAAA;AACJ,CAAC;AAdD,4BAcC"}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { Options, StringTask } from '../types';
|
||||
import { LogResult } from '../../../typings';
|
||||
export interface DefaultLogFields {
|
||||
hash: string;
|
||||
date: string;
|
||||
message: string;
|
||||
refs: string;
|
||||
body: string;
|
||||
author_name: string;
|
||||
author_email: string;
|
||||
}
|
||||
export declare type LogOptions<T = DefaultLogFields> = {
|
||||
file?: string;
|
||||
format?: T;
|
||||
from?: string;
|
||||
maxCount?: number;
|
||||
multiLine?: boolean;
|
||||
splitter?: string;
|
||||
strictDate?: boolean;
|
||||
symmetric?: boolean;
|
||||
to?: string;
|
||||
};
|
||||
export declare function parseLogOptions<T extends Options>(opt?: LogOptions<T>, customArgs?: string[]): {
|
||||
fields: string[];
|
||||
splitter: string;
|
||||
commands: string[];
|
||||
};
|
||||
export declare function logTask<T>(splitter: string, fields: string[], customArgs: string[]): StringTask<LogResult<T>>;
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.logTask = exports.parseLogOptions = void 0;
|
||||
const parse_list_log_summary_1 = require("../parsers/parse-list-log-summary");
|
||||
const utils_1 = require("../utils");
|
||||
var excludeOptions;
|
||||
(function (excludeOptions) {
|
||||
excludeOptions[excludeOptions["--pretty"] = 0] = "--pretty";
|
||||
excludeOptions[excludeOptions["max-count"] = 1] = "max-count";
|
||||
excludeOptions[excludeOptions["maxCount"] = 2] = "maxCount";
|
||||
excludeOptions[excludeOptions["n"] = 3] = "n";
|
||||
excludeOptions[excludeOptions["file"] = 4] = "file";
|
||||
excludeOptions[excludeOptions["format"] = 5] = "format";
|
||||
excludeOptions[excludeOptions["from"] = 6] = "from";
|
||||
excludeOptions[excludeOptions["to"] = 7] = "to";
|
||||
excludeOptions[excludeOptions["splitter"] = 8] = "splitter";
|
||||
excludeOptions[excludeOptions["symmetric"] = 9] = "symmetric";
|
||||
excludeOptions[excludeOptions["multiLine"] = 10] = "multiLine";
|
||||
excludeOptions[excludeOptions["strictDate"] = 11] = "strictDate";
|
||||
})(excludeOptions || (excludeOptions = {}));
|
||||
function prettyFormat(format, splitter) {
|
||||
const fields = [];
|
||||
const formatStr = [];
|
||||
Object.keys(format).forEach((field) => {
|
||||
fields.push(field);
|
||||
formatStr.push(String(format[field]));
|
||||
});
|
||||
return [
|
||||
fields, formatStr.join(splitter)
|
||||
];
|
||||
}
|
||||
function userOptions(input) {
|
||||
const output = Object.assign({}, input);
|
||||
Object.keys(input).forEach(key => {
|
||||
if (key in excludeOptions) {
|
||||
delete output[key];
|
||||
}
|
||||
});
|
||||
return output;
|
||||
}
|
||||
function parseLogOptions(opt = {}, customArgs = []) {
|
||||
const splitter = opt.splitter || parse_list_log_summary_1.SPLITTER;
|
||||
const format = opt.format || {
|
||||
hash: '%H',
|
||||
date: opt.strictDate === false ? '%ai' : '%aI',
|
||||
message: '%s',
|
||||
refs: '%D',
|
||||
body: opt.multiLine ? '%B' : '%b',
|
||||
author_name: '%aN',
|
||||
author_email: '%ae'
|
||||
};
|
||||
const [fields, formatStr] = prettyFormat(format, splitter);
|
||||
const suffix = [];
|
||||
const command = [
|
||||
`--pretty=format:${parse_list_log_summary_1.START_BOUNDARY}${formatStr}${parse_list_log_summary_1.COMMIT_BOUNDARY}`,
|
||||
...customArgs,
|
||||
];
|
||||
const maxCount = opt.n || opt['max-count'] || opt.maxCount;
|
||||
if (maxCount) {
|
||||
command.push(`--max-count=${maxCount}`);
|
||||
}
|
||||
if (opt.from && opt.to) {
|
||||
const rangeOperator = (opt.symmetric !== false) ? '...' : '..';
|
||||
suffix.push(`${opt.from}${rangeOperator}${opt.to}`);
|
||||
}
|
||||
if (opt.file) {
|
||||
suffix.push('--follow', opt.file);
|
||||
}
|
||||
utils_1.appendTaskOptions(userOptions(opt), command);
|
||||
return {
|
||||
fields,
|
||||
splitter,
|
||||
commands: [
|
||||
...command,
|
||||
...suffix,
|
||||
],
|
||||
};
|
||||
}
|
||||
exports.parseLogOptions = parseLogOptions;
|
||||
function logTask(splitter, fields, customArgs) {
|
||||
return {
|
||||
commands: ['log', ...customArgs],
|
||||
format: 'utf-8',
|
||||
parser: parse_list_log_summary_1.createListLogSummaryParser(splitter, fields),
|
||||
};
|
||||
}
|
||||
exports.logTask = logTask;
|
||||
//# sourceMappingURL=log.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"log.js","sourceRoot":"","sources":["log.ts"],"names":[],"mappings":";;;AAEA,8EAK2C;AAC3C,oCAA6C;AAE7C,IAAK,cAaJ;AAbD,WAAK,cAAc;IAChB,2DAAU,CAAA;IACV,6DAAW,CAAA;IACX,2DAAU,CAAA;IACV,6CAAG,CAAA;IACH,mDAAM,CAAA;IACN,uDAAQ,CAAA;IACR,mDAAM,CAAA;IACN,+CAAI,CAAA;IACJ,2DAAU,CAAA;IACV,6DAAW,CAAA;IACX,8DAAW,CAAA;IACX,gEAAY,CAAA;AACf,CAAC,EAbI,cAAc,KAAd,cAAc,QAalB;AAwBD,SAAS,YAAY,CAAC,MAAyC,EAAE,QAAgB;IAC9E,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,OAAO;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OAAO,CAAC,IAAI,CAAC,eAAgB,QAAS,EAAE,CAAC,CAAC;KAC5C;IAED,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE,EAAE;QACrB,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;KACtD;IAED,IAAI,GAAG,CAAC,IAAI,EAAE;QACX,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;KACpC;IAED,yBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IAE7C,OAAO;QACJ,MAAM;QACN,QAAQ;QACR,QAAQ,EAAE;YACP,GAAG,OAAO;YACV,GAAG,MAAM;SACX;KACH,CAAC;AACL,CAAC;AA5CD,0CA4CC;AAED,SAAgB,OAAO,CAAI,QAAgB,EAAE,MAAgB,EAAE,UAAoB;IAChF,OAAO;QACJ,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,UAAU,CAAC;QAChC,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,mDAA0B,CAAC,QAAQ,EAAE,MAAM,CAAC;KACtD,CAAC;AACL,CAAC;AAND,0BAMC"}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { MergeResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
import { EmptyTask } from './task';
|
||||
export declare function mergeTask(customArgs: string[]): EmptyTask | StringTask<MergeResult>;
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mergeTask = void 0;
|
||||
const api_1 = require("../api");
|
||||
const parse_merge_1 = require("../parsers/parse-merge");
|
||||
const task_1 = require("./task");
|
||||
function mergeTask(customArgs) {
|
||||
if (!customArgs.length) {
|
||||
return task_1.configurationErrorTask('Git.merge requires at least one option');
|
||||
}
|
||||
return {
|
||||
commands: ['merge', ...customArgs],
|
||||
format: 'utf-8',
|
||||
parser(stdOut, stdErr) {
|
||||
const merge = parse_merge_1.parseMergeResult(stdOut, stdErr);
|
||||
if (merge.failed) {
|
||||
throw new api_1.GitResponseError(merge);
|
||||
}
|
||||
return merge;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.mergeTask = mergeTask;
|
||||
//# sourceMappingURL=merge.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"merge.js","sourceRoot":"","sources":["merge.ts"],"names":[],"mappings":";;;AACA,gCAA0C;AAC1C,wDAA0D;AAE1D,iCAA2D;AAE3D,SAAgB,SAAS,CAAC,UAAoB;IAC3C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO,6BAAsB,CAAC,wCAAwC,CAAC,CAAC;KAC1E;IAED,OAAO;QACJ,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC;QAClC,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,MAAM,EAAE,MAAM;YAClB,MAAM,KAAK,GAAG,8BAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/C,IAAI,KAAK,CAAC,MAAM,EAAE;gBACf,MAAM,IAAI,sBAAgB,CAAC,KAAK,CAAC,CAAC;aACpC;YAED,OAAO,KAAK,CAAC;QAChB,CAAC;KACH,CAAA;AACJ,CAAC;AAjBD,8BAiBC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { MoveResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function moveTask(from: string | string[], to: string): StringTask<MoveResult>;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.moveTask = void 0;
|
||||
const parse_move_1 = require("../parsers/parse-move");
|
||||
const utils_1 = require("../utils");
|
||||
function moveTask(from, to) {
|
||||
return {
|
||||
commands: ['mv', '-v', ...utils_1.asArray(from), to],
|
||||
format: 'utf-8',
|
||||
parser: parse_move_1.parseMoveResult,
|
||||
};
|
||||
}
|
||||
exports.moveTask = moveTask;
|
||||
//# sourceMappingURL=move.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"move.js","sourceRoot":"","sources":["move.ts"],"names":[],"mappings":";;;AACA,sDAAwD;AAExD,oCAAmC;AAEnC,SAAgB,QAAQ,CAAC,IAAuB,EAAE,EAAU;IACzD,OAAO;QACJ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,eAAO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,4BAAe;KACzB,CAAC;AACL,CAAC;AAND,4BAMC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { PullResult } from '../../../typings';
|
||||
import { Maybe, StringTask } from '../types';
|
||||
export declare function pullTask(remote: Maybe<string>, branch: Maybe<string>, customArgs: string[]): StringTask<PullResult>;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pullTask = void 0;
|
||||
const parse_pull_1 = require("../parsers/parse-pull");
|
||||
function pullTask(remote, branch, customArgs) {
|
||||
const commands = ['pull', ...customArgs];
|
||||
if (remote && branch) {
|
||||
commands.splice(1, 0, remote, branch);
|
||||
}
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser(stdOut, stdErr) {
|
||||
return parse_pull_1.parsePullResult(stdOut, stdErr);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.pullTask = pullTask;
|
||||
//# sourceMappingURL=pull.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pull.js","sourceRoot":"","sources":["pull.ts"],"names":[],"mappings":";;;AACA,sDAAwD;AAGxD,SAAgB,QAAQ,CAAC,MAAqB,EAAE,MAAqB,EAAE,UAAoB;IACxF,MAAM,QAAQ,GAAa,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;IACnD,IAAI,MAAM,IAAI,MAAM,EAAE;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KACxC;IAED,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,MAAM,EAAE,MAAM;YAClB,OAAO,4BAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,CAAC;KACH,CAAA;AACJ,CAAC;AAbD,4BAaC"}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { PushResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
declare type PushRef = {
|
||||
remote?: string;
|
||||
branch?: string;
|
||||
};
|
||||
export declare function pushTagsTask(ref: PushRef | undefined, customArgs: string[]): StringTask<PushResult>;
|
||||
export declare function pushTask(ref: PushRef | undefined, customArgs: string[]): StringTask<PushResult>;
|
||||
export {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pushTask = exports.pushTagsTask = void 0;
|
||||
const parse_push_1 = require("../parsers/parse-push");
|
||||
const utils_1 = require("../utils");
|
||||
function pushTagsTask(ref = {}, customArgs) {
|
||||
utils_1.append(customArgs, '--tags');
|
||||
return pushTask(ref, customArgs);
|
||||
}
|
||||
exports.pushTagsTask = pushTagsTask;
|
||||
function pushTask(ref = {}, customArgs) {
|
||||
const commands = ['push', ...customArgs];
|
||||
if (ref.branch) {
|
||||
commands.splice(1, 0, ref.branch);
|
||||
}
|
||||
if (ref.remote) {
|
||||
commands.splice(1, 0, ref.remote);
|
||||
}
|
||||
utils_1.remove(commands, '-v');
|
||||
utils_1.append(commands, '--verbose');
|
||||
utils_1.append(commands, '--porcelain');
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser: parse_push_1.parsePushResult,
|
||||
};
|
||||
}
|
||||
exports.pushTask = pushTask;
|
||||
//# sourceMappingURL=push.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"push.js","sourceRoot":"","sources":["push.ts"],"names":[],"mappings":";;;AACA,sDAAkE;AAElE,oCAA0C;AAI1C,SAAgB,YAAY,CAAC,MAAe,EAAE,EAAE,UAAoB;IACjE,cAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC7B,OAAO,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACpC,CAAC;AAHD,oCAGC;AAED,SAAgB,QAAQ,CAAC,MAAe,EAAE,EAAE,UAAoB;IAC7D,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;IACzC,IAAI,GAAG,CAAC,MAAM,EAAE;QACb,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KACpC;IACD,IAAI,GAAG,CAAC,MAAM,EAAE;QACb,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KACpC;IAED,cAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvB,cAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC9B,cAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEhC,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,EAAN,4BAAM;KACR,CAAC;AACL,CAAC;AAlBD,4BAkBC"}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { StringTask } from '../types';
|
||||
export declare function addRemoteTask(remoteName: string, remoteRepo: string, customArgs?: string[]): StringTask<string>;
|
||||
export declare function getRemotesTask(verbose: boolean): StringTask<any>;
|
||||
export declare function listRemotesTask(customArgs?: string[]): StringTask<string>;
|
||||
export declare function remoteTask(customArgs?: string[]): StringTask<string>;
|
||||
export declare function removeRemoteTask(remoteName: string): StringTask<string>;
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.removeRemoteTask = exports.remoteTask = exports.listRemotesTask = exports.getRemotesTask = exports.addRemoteTask = void 0;
|
||||
const GetRemoteSummary_1 = require("../responses/GetRemoteSummary");
|
||||
const task_1 = require("./task");
|
||||
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
|
||||
+1
@@ -0,0 +1 @@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AC,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AACtE,CAAC;AAFD,4CAEC"}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { Maybe, OptionFlags, Options } from '../types';
|
||||
export declare enum ResetMode {
|
||||
MIXED = "mixed",
|
||||
SOFT = "soft",
|
||||
HARD = "hard",
|
||||
MERGE = "merge",
|
||||
KEEP = "keep"
|
||||
}
|
||||
export declare type ResetOptions = Options & OptionFlags<'-q' | '--quiet' | '--no-quiet' | '--pathspec-from-nul'> & OptionFlags<'--pathspec-from-file', string>;
|
||||
export declare function resetTask(mode: Maybe<ResetMode>, customArgs: string[]): import("../types").StringTask<string>;
|
||||
export declare function getResetMode(mode: ResetMode | any): Maybe<ResetMode>;
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getResetMode = exports.resetTask = exports.ResetMode = void 0;
|
||||
const task_1 = require("./task");
|
||||
var ResetMode;
|
||||
(function (ResetMode) {
|
||||
ResetMode["MIXED"] = "mixed";
|
||||
ResetMode["SOFT"] = "soft";
|
||||
ResetMode["HARD"] = "hard";
|
||||
ResetMode["MERGE"] = "merge";
|
||||
ResetMode["KEEP"] = "keep";
|
||||
})(ResetMode = exports.ResetMode || (exports.ResetMode = {}));
|
||||
const ResetModes = Array.from(Object.values(ResetMode));
|
||||
function resetTask(mode, customArgs) {
|
||||
const commands = ['reset'];
|
||||
if (isValidResetMode(mode)) {
|
||||
commands.push(`--${mode}`);
|
||||
}
|
||||
commands.push(...customArgs);
|
||||
return task_1.straightThroughStringTask(commands);
|
||||
}
|
||||
exports.resetTask = resetTask;
|
||||
function getResetMode(mode) {
|
||||
if (isValidResetMode(mode)) {
|
||||
return mode;
|
||||
}
|
||||
switch (typeof mode) {
|
||||
case 'string':
|
||||
case 'undefined':
|
||||
return ResetMode.SOFT;
|
||||
}
|
||||
return;
|
||||
}
|
||||
exports.getResetMode = getResetMode;
|
||||
function isValidResetMode(mode) {
|
||||
return ResetModes.includes(mode);
|
||||
}
|
||||
//# sourceMappingURL=reset.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"reset.js","sourceRoot":"","sources":["reset.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAGnD,IAAY,SAMX;AAND,WAAY,SAAS;IAClB,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,0BAAa,CAAA;AAChB,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAMxD,SAAgB,SAAS,CAAC,IAAsB,EAAE,UAAoB;IACnE,MAAM,QAAQ,GAAa,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;QACzB,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;KAC7B;IACD,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAE7B,OAAO,gCAAyB,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AARD,8BAQC;AAED,SAAgB,YAAY,CAAC,IAAqB;IAC/C,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACd;IAED,QAAQ,OAAO,IAAI,EAAE;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW;YACb,OAAO,SAAS,CAAC,IAAI,CAAC;KAC3B;IAED,OAAO;AACV,CAAC;AAZD,oCAYC;AAED,SAAS,gBAAgB,CAAC,IAAqB;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { LogOptions, LogResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function stashListTask(opt: LogOptions<import("./log").DefaultLogFields> | undefined, customArgs: string[]): StringTask<LogResult>;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.stashListTask = void 0;
|
||||
const parse_list_log_summary_1 = require("../parsers/parse-list-log-summary");
|
||||
const log_1 = require("./log");
|
||||
function stashListTask(opt = {}, customArgs) {
|
||||
const options = log_1.parseLogOptions(opt);
|
||||
const parser = parse_list_log_summary_1.createListLogSummaryParser(options.splitter, options.fields);
|
||||
return {
|
||||
commands: ['stash', 'list', ...options.commands, ...customArgs],
|
||||
format: 'utf-8',
|
||||
parser,
|
||||
};
|
||||
}
|
||||
exports.stashListTask = stashListTask;
|
||||
//# sourceMappingURL=stash-list.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"stash-list.js","sourceRoot":"","sources":["stash-list.ts"],"names":[],"mappings":";;;AACA,8EAA+E;AAE/E,+BAAwC;AAExC,SAAgB,aAAa,CAAC,MAAkB,EAAE,EAAE,UAAoB;IACrE,MAAM,OAAO,GAAG,qBAAe,CAAM,GAAG,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,mDAA0B,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5E,OAAO;QACJ,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,UAAU,CAAC;QAC/D,MAAM,EAAE,OAAO;QACf,MAAM;KACR,CAAC;AACL,CAAC;AATD,sCASC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { StatusResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
export declare function statusTask(customArgs: string[]): StringTask<StatusResult>;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.statusTask = void 0;
|
||||
const StatusSummary_1 = require("../responses/StatusSummary");
|
||||
function statusTask(customArgs) {
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['status', '--porcelain', '-b', '-u', ...customArgs],
|
||||
parser(text) {
|
||||
return StatusSummary_1.parseStatusSummary(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.statusTask = statusTask;
|
||||
//# sourceMappingURL=status.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"status.js","sourceRoot":"","sources":["status.ts"],"names":[],"mappings":";;;AACA,8DAAgE;AAGhE,SAAgB,UAAU,CAAC,UAAoB;IAC5C,OAAO;QACJ,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;QAC9D,MAAM,CAAC,IAAY;YAChB,OAAO,kCAAkB,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;KACH,CAAA;AACJ,CAAC;AARD,gCAQC"}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { StringTask } from '../types';
|
||||
export declare function addSubModuleTask(repo: string, path: string): StringTask<string>;
|
||||
export declare function initSubModuleTask(customArgs: string[]): StringTask<string>;
|
||||
export declare function subModuleTask(customArgs: string[]): StringTask<string>;
|
||||
export declare function updateSubModuleTask(customArgs: string[]): StringTask<string>;
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updateSubModuleTask = exports.subModuleTask = exports.initSubModuleTask = exports.addSubModuleTask = void 0;
|
||||
const task_1 = require("./task");
|
||||
function addSubModuleTask(repo, path) {
|
||||
return subModuleTask(['add', repo, path]);
|
||||
}
|
||||
exports.addSubModuleTask = addSubModuleTask;
|
||||
function initSubModuleTask(customArgs) {
|
||||
return subModuleTask(['init', ...customArgs]);
|
||||
}
|
||||
exports.initSubModuleTask = initSubModuleTask;
|
||||
function subModuleTask(customArgs) {
|
||||
const commands = [...customArgs];
|
||||
if (commands[0] !== 'submodule') {
|
||||
commands.unshift('submodule');
|
||||
}
|
||||
return task_1.straightThroughStringTask(commands);
|
||||
}
|
||||
exports.subModuleTask = subModuleTask;
|
||||
function updateSubModuleTask(customArgs) {
|
||||
return subModuleTask(['update', ...customArgs]);
|
||||
}
|
||||
exports.updateSubModuleTask = updateSubModuleTask;
|
||||
//# sourceMappingURL=sub-module.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sub-module.js","sourceRoot":"","sources":["sub-module.ts"],"names":[],"mappings":";;;AACA,iCAAmD;AAEnD,SAAgB,gBAAgB,CAAC,IAAY,EAAE,IAAY;IACxD,OAAO,aAAa,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,4CAEC;AAED,SAAgB,iBAAiB,CAAC,UAAoB;IACnD,OAAO,aAAa,CAAC,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,8CAEC;AAED,SAAgB,aAAa,CAAC,UAAoB;IAC/C,MAAM,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;IACjC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE;QAC9B,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;KAChC;IAED,OAAO,gCAAyB,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAPD,sCAOC;AAED,SAAgB,mBAAmB,CAAC,UAAoB;IACrD,OAAO,aAAa,CAAC,CAAC,QAAQ,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;AACnD,CAAC;AAFD,kDAEC"}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { TagResult } from '../../../typings';
|
||||
import { StringTask } from '../types';
|
||||
/**
|
||||
* Task used by `git.tags`
|
||||
*/
|
||||
export declare function tagListTask(customArgs?: string[]): StringTask<TagResult>;
|
||||
/**
|
||||
* Task used by `git.addTag`
|
||||
*/
|
||||
export declare function addTagTask(name: string): StringTask<{
|
||||
name: string;
|
||||
}>;
|
||||
/**
|
||||
* Task used by `git.addTag`
|
||||
*/
|
||||
export declare function addAnnotatedTagTask(name: string, tagMessage: string): StringTask<{
|
||||
name: string;
|
||||
}>;
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addAnnotatedTagTask = exports.addTagTask = exports.tagListTask = void 0;
|
||||
const TagList_1 = require("../responses/TagList");
|
||||
/**
|
||||
* Task used by `git.tags`
|
||||
*/
|
||||
function tagListTask(customArgs = []) {
|
||||
const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option));
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['tag', '-l', ...customArgs],
|
||||
parser(text) {
|
||||
return TagList_1.parseTagList(text, hasCustomSort);
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.tagListTask = tagListTask;
|
||||
/**
|
||||
* Task used by `git.addTag`
|
||||
*/
|
||||
function addTagTask(name) {
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['tag', name],
|
||||
parser() {
|
||||
return { name };
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.addTagTask = addTagTask;
|
||||
/**
|
||||
* Task used by `git.addTag`
|
||||
*/
|
||||
function addAnnotatedTagTask(name, tagMessage) {
|
||||
return {
|
||||
format: 'utf-8',
|
||||
commands: ['tag', '-a', '-m', tagMessage, name],
|
||||
parser() {
|
||||
return { name };
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.addAnnotatedTagTask = addAnnotatedTagTask;
|
||||
//# sourceMappingURL=tag.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"tag.js","sourceRoot":"","sources":["tag.ts"],"names":[],"mappings":";;;AACA,kDAAoD;AAGpD;;GAEG;AACH,SAAgB,WAAW,CAAE,aAAuB,EAAE;IACnD,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3E,OAAO;QACJ,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;QACtC,MAAM,CAAE,IAAY;YACjB,OAAO,sBAAY,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC5C,CAAC;KACH,CAAA;AACJ,CAAC;AAVD,kCAUC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAE,IAAY;IACrC,OAAO;QACJ,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QACvB,MAAM;YACH,OAAO,EAAC,IAAI,EAAC,CAAC;QACjB,CAAC;KACH,CAAA;AACJ,CAAC;AARD,gCAQC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAE,IAAY,EAAE,UAAkB;IAClE,OAAO;QACJ,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;QAC/C,MAAM;YACH,OAAO,EAAC,IAAI,EAAC,CAAC;QACjB,CAAC;KACH,CAAA;AACJ,CAAC;AARD,kDAQC"}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { BufferTask, EmptyTaskParser, SimpleGitTask, SimpleGitTaskConfiguration, StringTask } from '../types';
|
||||
export declare const EMPTY_COMMANDS: [];
|
||||
export declare type EmptyTask<RESPONSE = void> = SimpleGitTaskConfiguration<RESPONSE, 'utf-8', string> & {
|
||||
commands: typeof EMPTY_COMMANDS;
|
||||
parser: EmptyTaskParser<RESPONSE>;
|
||||
};
|
||||
export declare function adhocExecTask<R>(parser: () => R): StringTask<R>;
|
||||
export declare function configurationErrorTask(error: Error | string): EmptyTask;
|
||||
export declare function straightThroughStringTask(commands: string[], trimmed?: boolean): StringTask<string>;
|
||||
export declare function isBufferTask<R>(task: SimpleGitTask<R>): task is BufferTask<R>;
|
||||
export declare function isEmptyTask<R>(task: SimpleGitTask<R>): task is EmptyTask;
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isEmptyTask = exports.isBufferTask = exports.straightThroughStringTask = exports.configurationErrorTask = exports.adhocExecTask = exports.EMPTY_COMMANDS = void 0;
|
||||
const task_configuration_error_1 = require("../errors/task-configuration-error");
|
||||
exports.EMPTY_COMMANDS = [];
|
||||
function adhocExecTask(parser) {
|
||||
return {
|
||||
commands: exports.EMPTY_COMMANDS,
|
||||
format: 'utf-8',
|
||||
parser,
|
||||
};
|
||||
}
|
||||
exports.adhocExecTask = adhocExecTask;
|
||||
function configurationErrorTask(error) {
|
||||
return {
|
||||
commands: exports.EMPTY_COMMANDS,
|
||||
format: 'utf-8',
|
||||
parser() {
|
||||
throw typeof error === 'string' ? new task_configuration_error_1.TaskConfigurationError(error) : error;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.configurationErrorTask = configurationErrorTask;
|
||||
function straightThroughStringTask(commands, trimmed = false) {
|
||||
return {
|
||||
commands,
|
||||
format: 'utf-8',
|
||||
parser(text) {
|
||||
return trimmed ? String(text).trim() : text;
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.straightThroughStringTask = straightThroughStringTask;
|
||||
function isBufferTask(task) {
|
||||
return task.format === 'buffer';
|
||||
}
|
||||
exports.isBufferTask = isBufferTask;
|
||||
function isEmptyTask(task) {
|
||||
return !task.commands.length;
|
||||
}
|
||||
exports.isEmptyTask = isEmptyTask;
|
||||
//# sourceMappingURL=task.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"task.js","sourceRoot":"","sources":["task.ts"],"names":[],"mappings":";;;AAAA,iFAA4E;AAG/D,QAAA,cAAc,GAAO,EAAE,CAAC;AAQrC,SAAgB,aAAa,CAAI,MAAe;IAC7C,OAAO;QACJ,QAAQ,EAAE,sBAAc;QACxB,MAAM,EAAE,OAAO;QACf,MAAM;KACR,CAAA;AACJ,CAAC;AAND,sCAMC;AAED,SAAgB,sBAAsB,CAAC,KAAqB;IACzD,OAAO;QACJ,QAAQ,EAAE,sBAAc;QACxB,MAAM,EAAE,OAAO;QACf,MAAM;YACH,MAAM,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,iDAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC/E,CAAC;KACH,CAAA;AACJ,CAAC;AARD,wDAQC;AAED,SAAgB,yBAAyB,CAAC,QAAkB,EAAE,OAAO,GAAG,KAAK;IAC1E,OAAO;QACJ,QAAQ;QACR,MAAM,EAAE,OAAO;QACf,MAAM,CAAC,IAAI;YACR,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC;KACH,CAAA;AACJ,CAAC;AARD,8DAQC;AAED,SAAgB,YAAY,CAAI,IAAsB;IACnD,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC;AACnC,CAAC;AAFD,oCAEC;AAED,SAAgB,WAAW,CAAI,IAAsB;IAClD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChC,CAAC;AAFD,kCAEC"}
|
||||
Reference in new issue
Block a user