Socket
Socket
Sign inDemoInstall

git-kitchen-sink

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-kitchen-sink - npm Package Compare versions

Comparing version 1.18.0 to 1.19.0

66

build/lib/errors.d.ts
/** The git errors which can be parsed from failed git commands. */
export declare enum GitError {
GitNotFound = 0,
SSHKeyAuditUnverified = 1,
SSHAuthenticationFailed = 2,
SSHPermissionDenied = 3,
HTTPSAuthenticationFailed = 4,
RemoteDisconnection = 5,
HostDown = 6,
RebaseConflicts = 7,
MergeConflicts = 8,
HTTPSRepositoryNotFound = 9,
SSHRepositoryNotFound = 10,
PushNotFastForward = 11,
BranchDeletionFailed = 12,
DefaultBranchDeletionFailed = 13,
RevertConflicts = 14,
EmptyRebasePatch = 15,
NoMatchingRemoteBranch = 16,
NothingToCommit = 17,
NoSubmoduleMapping = 18,
SubmoduleRepositoryDoesNotExist = 19,
InvalidSubmoduleSHA = 20,
LocalPermissionDenied = 21,
InvalidMerge = 22,
InvalidRebase = 23,
NonFastForwardMergeIntoEmptyHead = 24,
PatchDoesNotApply = 25,
BranchAlreadyExists = 26,
BadRevision = 27,
SSHKeyAuditUnverified = 0,
SSHAuthenticationFailed = 1,
SSHPermissionDenied = 2,
HTTPSAuthenticationFailed = 3,
RemoteDisconnection = 4,
HostDown = 5,
RebaseConflicts = 6,
MergeConflicts = 7,
HTTPSRepositoryNotFound = 8,
SSHRepositoryNotFound = 9,
PushNotFastForward = 10,
BranchDeletionFailed = 11,
DefaultBranchDeletionFailed = 12,
RevertConflicts = 13,
EmptyRebasePatch = 14,
NoMatchingRemoteBranch = 15,
NothingToCommit = 16,
NoSubmoduleMapping = 17,
SubmoduleRepositoryDoesNotExist = 18,
InvalidSubmoduleSHA = 19,
LocalPermissionDenied = 20,
InvalidMerge = 21,
InvalidRebase = 22,
NonFastForwardMergeIntoEmptyHead = 23,
PatchDoesNotApply = 24,
BranchAlreadyExists = 25,
BadRevision = 26,
NotAGitRepository = 27,
}

@@ -62,4 +62,10 @@ /** A mapping from regexes to the git error they identify. */

"fatal: bad revision '(.*)'": GitError;
"fatal: Not a git repository (or any of the parent directories): (.*)": GitError;
};
/** The exit code for 'Error No Entry' which could mean many things */
export declare const NotFoundExitCode = "ENOENT";
/**
* The error code for when git cannot be found. This most likely indicates a
* problem with git-kitchen-sink itself.
*/
export declare const GitNotFoundErrorCode = "git-not-found-error";
/** The error code for when the path to a repository doesn't exist. */
export declare const RepositoryDoesNotExistErrorCode = "repository-does-not-exist-error";

@@ -5,30 +5,30 @@ "use strict";

(function (GitError) {
GitError[GitError["GitNotFound"] = 0] = "GitNotFound";
GitError[GitError["SSHKeyAuditUnverified"] = 1] = "SSHKeyAuditUnverified";
GitError[GitError["SSHAuthenticationFailed"] = 2] = "SSHAuthenticationFailed";
GitError[GitError["SSHPermissionDenied"] = 3] = "SSHPermissionDenied";
GitError[GitError["HTTPSAuthenticationFailed"] = 4] = "HTTPSAuthenticationFailed";
GitError[GitError["RemoteDisconnection"] = 5] = "RemoteDisconnection";
GitError[GitError["HostDown"] = 6] = "HostDown";
GitError[GitError["RebaseConflicts"] = 7] = "RebaseConflicts";
GitError[GitError["MergeConflicts"] = 8] = "MergeConflicts";
GitError[GitError["HTTPSRepositoryNotFound"] = 9] = "HTTPSRepositoryNotFound";
GitError[GitError["SSHRepositoryNotFound"] = 10] = "SSHRepositoryNotFound";
GitError[GitError["PushNotFastForward"] = 11] = "PushNotFastForward";
GitError[GitError["BranchDeletionFailed"] = 12] = "BranchDeletionFailed";
GitError[GitError["DefaultBranchDeletionFailed"] = 13] = "DefaultBranchDeletionFailed";
GitError[GitError["RevertConflicts"] = 14] = "RevertConflicts";
GitError[GitError["EmptyRebasePatch"] = 15] = "EmptyRebasePatch";
GitError[GitError["NoMatchingRemoteBranch"] = 16] = "NoMatchingRemoteBranch";
GitError[GitError["NothingToCommit"] = 17] = "NothingToCommit";
GitError[GitError["NoSubmoduleMapping"] = 18] = "NoSubmoduleMapping";
GitError[GitError["SubmoduleRepositoryDoesNotExist"] = 19] = "SubmoduleRepositoryDoesNotExist";
GitError[GitError["InvalidSubmoduleSHA"] = 20] = "InvalidSubmoduleSHA";
GitError[GitError["LocalPermissionDenied"] = 21] = "LocalPermissionDenied";
GitError[GitError["InvalidMerge"] = 22] = "InvalidMerge";
GitError[GitError["InvalidRebase"] = 23] = "InvalidRebase";
GitError[GitError["NonFastForwardMergeIntoEmptyHead"] = 24] = "NonFastForwardMergeIntoEmptyHead";
GitError[GitError["PatchDoesNotApply"] = 25] = "PatchDoesNotApply";
GitError[GitError["BranchAlreadyExists"] = 26] = "BranchAlreadyExists";
GitError[GitError["BadRevision"] = 27] = "BadRevision";
GitError[GitError["SSHKeyAuditUnverified"] = 0] = "SSHKeyAuditUnverified";
GitError[GitError["SSHAuthenticationFailed"] = 1] = "SSHAuthenticationFailed";
GitError[GitError["SSHPermissionDenied"] = 2] = "SSHPermissionDenied";
GitError[GitError["HTTPSAuthenticationFailed"] = 3] = "HTTPSAuthenticationFailed";
GitError[GitError["RemoteDisconnection"] = 4] = "RemoteDisconnection";
GitError[GitError["HostDown"] = 5] = "HostDown";
GitError[GitError["RebaseConflicts"] = 6] = "RebaseConflicts";
GitError[GitError["MergeConflicts"] = 7] = "MergeConflicts";
GitError[GitError["HTTPSRepositoryNotFound"] = 8] = "HTTPSRepositoryNotFound";
GitError[GitError["SSHRepositoryNotFound"] = 9] = "SSHRepositoryNotFound";
GitError[GitError["PushNotFastForward"] = 10] = "PushNotFastForward";
GitError[GitError["BranchDeletionFailed"] = 11] = "BranchDeletionFailed";
GitError[GitError["DefaultBranchDeletionFailed"] = 12] = "DefaultBranchDeletionFailed";
GitError[GitError["RevertConflicts"] = 13] = "RevertConflicts";
GitError[GitError["EmptyRebasePatch"] = 14] = "EmptyRebasePatch";
GitError[GitError["NoMatchingRemoteBranch"] = 15] = "NoMatchingRemoteBranch";
GitError[GitError["NothingToCommit"] = 16] = "NothingToCommit";
GitError[GitError["NoSubmoduleMapping"] = 17] = "NoSubmoduleMapping";
GitError[GitError["SubmoduleRepositoryDoesNotExist"] = 18] = "SubmoduleRepositoryDoesNotExist";
GitError[GitError["InvalidSubmoduleSHA"] = 19] = "InvalidSubmoduleSHA";
GitError[GitError["LocalPermissionDenied"] = 20] = "LocalPermissionDenied";
GitError[GitError["InvalidMerge"] = 21] = "InvalidMerge";
GitError[GitError["InvalidRebase"] = 22] = "InvalidRebase";
GitError[GitError["NonFastForwardMergeIntoEmptyHead"] = 23] = "NonFastForwardMergeIntoEmptyHead";
GitError[GitError["PatchDoesNotApply"] = 24] = "PatchDoesNotApply";
GitError[GitError["BranchAlreadyExists"] = 25] = "BranchAlreadyExists";
GitError[GitError["BadRevision"] = 26] = "BadRevision";
GitError[GitError["NotAGitRepository"] = 27] = "NotAGitRepository";
})(GitError = exports.GitError || (exports.GitError = {}));

@@ -65,5 +65,11 @@ /** A mapping from regexes to the git error they identify. */

"fatal: bad revision '(.*)'": GitError.BadRevision,
"fatal: Not a git repository (or any of the parent directories): (.*)": GitError.NotAGitRepository,
};
/** The exit code for 'Error No Entry' which could mean many things */
exports.NotFoundExitCode = "ENOENT";
/**
* The error code for when git cannot be found. This most likely indicates a
* problem with git-kitchen-sink itself.
*/
exports.GitNotFoundErrorCode = 'git-not-found-error';
/** The error code for when the path to a repository doesn't exist. */
exports.RepositoryDoesNotExistErrorCode = 'repository-does-not-exist-error';
//# sourceMappingURL=errors.js.map

@@ -67,4 +67,8 @@ /// <reference types="node" />

*
* The returned promise will only reject when the git executable failed to launch.
* See the result's `stderr` and `exitCode` for any potential error information.
* The returned promise will reject when the git executable fails to launch,
* in which case the thrown Error will have a string `code` property. See
* `errors.ts` for some of the known error codes.
*
* See the result's `stderr` and `exitCode` for any potential git error
* information.
*/

@@ -71,0 +75,0 @@ static exec(args: string[], path: string, options?: IGitExecutionOptions): Promise<IGitResult>;

@@ -54,4 +54,8 @@ "use strict";

*
* The returned promise will only reject when the git executable failed to launch.
* See the result's `stderr` and `exitCode` for any potential error information.
* The returned promise will reject when the git executable fails to launch,
* in which case the thrown Error will have a string `code` property. See
* `errors.ts` for some of the known error codes.
*
* See the result's `stderr` and `exitCode` for any potential git error
* information.
*/

@@ -109,8 +113,25 @@ static exec(args, path, options) {

const code = err ? err.code : 0;
if (code === errors_1.NotFoundExitCode) {
if (GitProcess.pathExists(path) === false) {
reject(new Error('Unable to find path to repository on disk.'));
return;
// If the error's code is a string then it means the code isn't the
// process's exit code but rather an error coming from Node's bowels,
// e.g., ENOENT.
if (typeof code === 'string') {
if (code === 'ENOENT') {
let message = err.message;
let code = err.code;
if (GitProcess.pathExists(path) === false) {
message = 'Unable to find path to repository on disk.';
code = errors_1.RepositoryDoesNotExistErrorCode;
}
else {
message = 'Git could not be found. This is most likely a problem in git-kitchen-sink itself.';
code = errors_1.GitNotFoundErrorCode;
}
const error = new Error(message);
error.name = err.name;
error.code = code;
reject(error);
}
reject(new Error('Git could not be found. This is most likely a problem in git-kitchen-sink itself.'));
else {
reject(err);
}
return;

@@ -117,0 +138,0 @@ }

export { GitProcess, IGitResult, IGitExecutionOptions } from './git-process';
export { GitError } from './errors';
export { GitError, RepositoryDoesNotExistErrorCode, GitNotFoundErrorCode } from './errors';

@@ -6,2 +6,4 @@ "use strict";

exports.GitError = errors_1.GitError;
exports.RepositoryDoesNotExistErrorCode = errors_1.RepositoryDoesNotExistErrorCode;
exports.GitNotFoundErrorCode = errors_1.GitNotFoundErrorCode;
//# sourceMappingURL=index.js.map
{
"name": "git-kitchen-sink",
"version": "1.18.0",
"version": "1.19.0",
"description": "Incorporate Git into your Electron application",

@@ -11,6 +11,2 @@ "main": "./build/lib/index.js",

"build": "npm run clean && npm run lint && tsc -p ./tsconfig.json",
"pack-win": "npm run build && node ./build/script/package.js win32",
"pack-mac": "npm run build && node ./build/script/package.js darwin",
"pack-linux": "npm run build && node ./build/script/package.js linux",
"pack": "npm run pack-win && npm run pack-mac && npm run pack-linux",
"prepublish": "npm run build && npm run test",

@@ -17,0 +13,0 @@ "test": "npm run test:fast && npm run test:slow",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc