Comparing version 1.31.0 to 1.32.0
@@ -15,2 +15,14 @@ /// <reference types="node" /> | ||
* A set of configuration options that can be passed when | ||
* executing a streaming Git command. | ||
*/ | ||
export interface IGitSpawnExecutionOptions { | ||
/** | ||
* An optional collection of key-value pairs which will be | ||
* set as environment variables before executing the git | ||
* process. | ||
*/ | ||
readonly env?: Object; | ||
} | ||
/** | ||
* A set of configuration options that can be passed when | ||
* executing a git command. | ||
@@ -56,2 +68,10 @@ */ | ||
/** | ||
* Execute a command and interact with the process outputs directly. | ||
* | ||
* 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. | ||
*/ | ||
static spawn(args: string[], path: string, options?: IGitSpawnExecutionOptions): ChildProcess; | ||
/** | ||
* Execute a command and read the output using the embedded Git environment. | ||
@@ -58,0 +78,0 @@ * |
@@ -18,2 +18,22 @@ "use strict"; | ||
/** | ||
* Execute a command and interact with the process outputs directly. | ||
* | ||
* 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. | ||
*/ | ||
static spawn(args, path, options) { | ||
let customEnv = {}; | ||
if (options && options.env) { | ||
customEnv = options.env; | ||
} | ||
const { env, gitLocation } = git_environment_1.setupEnvironment(customEnv); | ||
const spawnArgs = { | ||
env, | ||
cwd: path | ||
}; | ||
const spawnedProcess = child_process_1.spawn(gitLocation, args, spawnArgs); | ||
return spawnedProcess; | ||
} | ||
/** | ||
* Execute a command and read the output using the embedded Git environment. | ||
@@ -20,0 +40,0 @@ * |
{ | ||
"name": "dugite", | ||
"version": "1.31.0", | ||
"version": "1.32.0", | ||
"description": "Elegant bindings for Git", | ||
@@ -15,3 +15,3 @@ "main": "./build/lib/index.js", | ||
"test:fast": "cross-env LOCAL_GIT_DIRECTORY=./git/ mocha --require ts-node/register test/fast/*.ts test/auth/*.ts", | ||
"test:slow": "cross-env LOCAL_GIT_DIRECTORY=./git/ mocha -t 10000ms --require ts-node/register test/slow/*.ts test/auth/*.ts", | ||
"test:slow": "cross-env LOCAL_GIT_DIRECTORY=./git/ mocha -t 20000ms --require ts-node/register test/slow/*.ts test/auth/*.ts", | ||
"postinstall": "node ./script/download-git.js" | ||
@@ -18,0 +18,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53626
836