simple git installed
This commit is contained in:
1 parent
e2a8f4be8e
commit
f2e744cb7e
276 files changed
+11110
-1
No files matched your search
+15
@@ -0,0 +1,15 @@
|
||||
import { GitError } from './git-error';
|
||||
import { SimpleGitOptions } from '../types';
|
||||
/**
|
||||
* The `GitConstructError` is thrown when an error occurs in the constructor
|
||||
* of the `simple-git` instance itself. Most commonly as a result of using
|
||||
* a `baseDir` option that points to a folder that either does not exist,
|
||||
* or cannot be read by the user the node script is running as.
|
||||
*
|
||||
* Check the `.message` property for more detail including the properties
|
||||
* passed to the constructor.
|
||||
*/
|
||||
export declare class GitConstructError extends GitError {
|
||||
readonly config: SimpleGitOptions;
|
||||
constructor(config: SimpleGitOptions, message: string);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GitConstructError = void 0;
|
||||
const git_error_1 = require("./git-error");
|
||||
/**
|
||||
* The `GitConstructError` is thrown when an error occurs in the constructor
|
||||
* of the `simple-git` instance itself. Most commonly as a result of using
|
||||
* a `baseDir` option that points to a folder that either does not exist,
|
||||
* or cannot be read by the user the node script is running as.
|
||||
*
|
||||
* Check the `.message` property for more detail including the properties
|
||||
* passed to the constructor.
|
||||
*/
|
||||
class GitConstructError extends git_error_1.GitError {
|
||||
constructor(config, message) {
|
||||
super(undefined, message);
|
||||
this.config = config;
|
||||
}
|
||||
}
|
||||
exports.GitConstructError = GitConstructError;
|
||||
//# sourceMappingURL=git-construct-error.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"git-construct-error.js","sourceRoot":"","sources":["git-construct-error.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAGvC;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,oBAAQ;IAE5C,YACmB,MAAwB,EACxC,OAAe;QAEf,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAHV,WAAM,GAAN,MAAM,CAAkB;IAI3C,CAAC;CAEH;AATD,8CASC"}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* The `GitError` is thrown when the underlying `git` process throws a
|
||||
* fatal exception (eg an `ENOENT` exception when attempting to use a
|
||||
* non-writable directory as the root for your repo), and acts as the
|
||||
* base class for more specific errors thrown by the parsing of the
|
||||
* git response or errors in the configuration of the task about to
|
||||
* be run.
|
||||
*
|
||||
* When an exception is thrown, pending tasks in the same instance will
|
||||
* not be executed. The recommended way to run a series of tasks that
|
||||
* can independently fail without needing to prevent future tasks from
|
||||
* running is to catch them individually:
|
||||
*
|
||||
* ```typescript
|
||||
import { gitP, SimpleGit, GitError, PullResult } from 'simple-git';
|
||||
|
||||
function catchTask (e: GitError) {
|
||||
return e.
|
||||
}
|
||||
|
||||
const git = gitP(repoWorkingDir);
|
||||
const pulled: PullResult | GitError = await git.pull().catch(catchTask);
|
||||
const pushed: string | GitError = await git.pushTags().catch(catchTask);
|
||||
```
|
||||
*/
|
||||
export declare class GitError extends Error {
|
||||
task?: import("../tasks/task").EmptyTask<void> | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined;
|
||||
constructor(task?: import("../tasks/task").EmptyTask<void> | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined, message?: string);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GitError = void 0;
|
||||
/**
|
||||
* The `GitError` is thrown when the underlying `git` process throws a
|
||||
* fatal exception (eg an `ENOENT` exception when attempting to use a
|
||||
* non-writable directory as the root for your repo), and acts as the
|
||||
* base class for more specific errors thrown by the parsing of the
|
||||
* git response or errors in the configuration of the task about to
|
||||
* be run.
|
||||
*
|
||||
* When an exception is thrown, pending tasks in the same instance will
|
||||
* not be executed. The recommended way to run a series of tasks that
|
||||
* can independently fail without needing to prevent future tasks from
|
||||
* running is to catch them individually:
|
||||
*
|
||||
* ```typescript
|
||||
import { gitP, SimpleGit, GitError, PullResult } from 'simple-git';
|
||||
|
||||
function catchTask (e: GitError) {
|
||||
return e.
|
||||
}
|
||||
|
||||
const git = gitP(repoWorkingDir);
|
||||
const pulled: PullResult | GitError = await git.pull().catch(catchTask);
|
||||
const pushed: string | GitError = await git.pushTags().catch(catchTask);
|
||||
```
|
||||
*/
|
||||
class GitError extends Error {
|
||||
constructor(task, message) {
|
||||
super(message);
|
||||
this.task = task;
|
||||
Object.setPrototypeOf(this, new.target.prototype);
|
||||
}
|
||||
}
|
||||
exports.GitError = GitError;
|
||||
//# sourceMappingURL=git-error.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"git-error.js","sourceRoot":"","sources":["git-error.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAa,QAAS,SAAQ,KAAK;IAEhC,YACU,IAAyB,EAChC,OAAgB;QAEhB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAqB;QAIhC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CAEH;AAVD,4BAUC"}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { GitError } from './git-error';
|
||||
/**
|
||||
* The `GitResponseError` is the wrapper for a parsed response that is treated as
|
||||
* a fatal error, for example attempting a `merge` can leave the repo in a corrupted
|
||||
* state when there are conflicts so the task will reject rather than resolve.
|
||||
*
|
||||
* For example, catching the merge conflict exception:
|
||||
*
|
||||
* ```typescript
|
||||
import { gitP, SimpleGit, GitResponseError, MergeSummary } from 'simple-git';
|
||||
|
||||
const git = gitP(repoRoot);
|
||||
const mergeOptions: string[] = ['--no-ff', 'other-branch'];
|
||||
const mergeSummary: MergeSummary = await git.merge(mergeOptions)
|
||||
.catch((e: GitResponseError<MergeSummary>) => e.git);
|
||||
|
||||
if (mergeSummary.failed) {
|
||||
// deal with the error
|
||||
}
|
||||
```
|
||||
*/
|
||||
export declare class GitResponseError<T = any> extends GitError {
|
||||
/**
|
||||
* `.git` access the parsed response that is treated as being an error
|
||||
*/
|
||||
readonly git: T;
|
||||
constructor(
|
||||
/**
|
||||
* `.git` access the parsed response that is treated as being an error
|
||||
*/
|
||||
git: T, message?: string);
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GitResponseError = void 0;
|
||||
const git_error_1 = require("./git-error");
|
||||
/**
|
||||
* The `GitResponseError` is the wrapper for a parsed response that is treated as
|
||||
* a fatal error, for example attempting a `merge` can leave the repo in a corrupted
|
||||
* state when there are conflicts so the task will reject rather than resolve.
|
||||
*
|
||||
* For example, catching the merge conflict exception:
|
||||
*
|
||||
* ```typescript
|
||||
import { gitP, SimpleGit, GitResponseError, MergeSummary } from 'simple-git';
|
||||
|
||||
const git = gitP(repoRoot);
|
||||
const mergeOptions: string[] = ['--no-ff', 'other-branch'];
|
||||
const mergeSummary: MergeSummary = await git.merge(mergeOptions)
|
||||
.catch((e: GitResponseError<MergeSummary>) => e.git);
|
||||
|
||||
if (mergeSummary.failed) {
|
||||
// deal with the error
|
||||
}
|
||||
```
|
||||
*/
|
||||
class GitResponseError extends git_error_1.GitError {
|
||||
constructor(
|
||||
/**
|
||||
* `.git` access the parsed response that is treated as being an error
|
||||
*/
|
||||
git, message) {
|
||||
super(undefined, message || String(git));
|
||||
this.git = git;
|
||||
}
|
||||
}
|
||||
exports.GitResponseError = GitResponseError;
|
||||
//# sourceMappingURL=git-response-error.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"git-response-error.js","sourceRoot":"","sources":["git-response-error.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAEvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,gBAA0B,SAAQ,oBAAQ;IAEpD;IACG;;OAEG;IACa,GAAM,EACtB,OAAgB;QAEhB,KAAK,CAAC,SAAS,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAHzB,QAAG,GAAH,GAAG,CAAG;IAIzB,CAAC;CAEH;AAZD,4CAYC"}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { GitError } from './git-error';
|
||||
/**
|
||||
* The `TaskConfigurationError` is thrown when a command was incorrectly
|
||||
* configured. An error of this kind means that no attempt was made to
|
||||
* run your command through the underlying `git` binary.
|
||||
*
|
||||
* Check the `.message` property for more detail on why your configuration
|
||||
* resulted in an error.
|
||||
*/
|
||||
export declare class TaskConfigurationError extends GitError {
|
||||
constructor(message?: string);
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TaskConfigurationError = void 0;
|
||||
const git_error_1 = require("./git-error");
|
||||
/**
|
||||
* The `TaskConfigurationError` is thrown when a command was incorrectly
|
||||
* configured. An error of this kind means that no attempt was made to
|
||||
* run your command through the underlying `git` binary.
|
||||
*
|
||||
* Check the `.message` property for more detail on why your configuration
|
||||
* resulted in an error.
|
||||
*/
|
||||
class TaskConfigurationError extends git_error_1.GitError {
|
||||
constructor(message) {
|
||||
super(undefined, message);
|
||||
}
|
||||
}
|
||||
exports.TaskConfigurationError = TaskConfigurationError;
|
||||
//# sourceMappingURL=task-configuration-error.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"task-configuration-error.js","sourceRoot":"","sources":["task-configuration-error.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAEvC;;;;;;;GAOG;AACH,MAAa,sBAAuB,SAAQ,oBAAQ;IAEjD,YACG,OAAgB;QAEhB,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CAEH;AARD,wDAQC"}
|
||||
Reference in new issue
Block a user