simple-git
Advanced tools
Comparing version 2.39.1 to 2.40.0
# Change History & Release Notes | ||
## [2.40.0](https://www.github.com/steveukx/git-js/compare/v2.39.1...v2.40.0) (2021-06-12) | ||
### Features | ||
* create the `spawnOptions` plugin to allow setting `uid` / `gid` owner for the spawned `git` child processes. ([cc70220](https://www.github.com/steveukx/git-js/commit/cc70220f7636372a4aacd0fb5a74ee98dee54e0d)) | ||
### [2.39.1](https://www.github.com/steveukx/git-js/compare/v2.39.0...v2.39.1) (2021-06-09) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "simple-git", | ||
"description": "Simple GIT interface for node.js", | ||
"version": "2.39.1", | ||
"version": "2.40.0", | ||
"author": "Steve King <steve@mydev.co>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -88,2 +88,5 @@ # Simple Git | ||
- [Spawned Process Ownership](./docs/PLUGIN-SPAWN-OPTIONS.md) | ||
Configure the system `uid` / `gid` to use for spawned `git` processes. | ||
- [Timeout](./docs/PLUGIN-TIMEOUT.md) | ||
@@ -90,0 +93,0 @@ Automatically kill the wrapped `git` process after a rolling timeout. |
import { GitError } from './git-error'; | ||
export declare class GitPluginError extends GitError { | ||
task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined; | ||
readonly plugin?: "progress" | "timeout" | "errors" | "baseDir" | "binary" | "maxConcurrentProcesses" | "config" | undefined; | ||
constructor(task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined, plugin?: "progress" | "timeout" | "errors" | "baseDir" | "binary" | "maxConcurrentProcesses" | "config" | undefined, message?: string); | ||
readonly plugin?: "progress" | "timeout" | "errors" | "spawnOptions" | "baseDir" | "binary" | "maxConcurrentProcesses" | "config" | undefined; | ||
constructor(task?: import("../tasks/task").EmptyTask | import("../types").StringTask<any> | import("../types").BufferTask<any> | undefined, plugin?: "progress" | "timeout" | "errors" | "spawnOptions" | "baseDir" | "binary" | "maxConcurrentProcesses" | "config" | undefined, message?: string); | ||
} |
@@ -38,2 +38,3 @@ "use strict"; | ||
config.timeout && plugins.add(plugins_1.timeoutPlugin(config.timeout)); | ||
config.spawnOptions && plugins.add(plugins_1.spawnOptionsPlugin(config.spawnOptions)); | ||
plugins.add(plugins_1.errorDetectionPlugin(plugins_1.errorDetectionHandler(true))); | ||
@@ -40,0 +41,0 @@ config.errors && plugins.add(plugins_1.errorDetectionPlugin(config.errors)); |
@@ -6,2 +6,3 @@ export * from './command-config-prefixing-plugin'; | ||
export * from './simple-git-plugin'; | ||
export * from './spawn-options-plugin'; | ||
export * from './timout-plugin'; |
@@ -18,3 +18,4 @@ "use strict"; | ||
__exportStar(require("./simple-git-plugin"), exports); | ||
__exportStar(require("./spawn-options-plugin"), exports); | ||
__exportStar(require("./timout-plugin"), exports); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import { ChildProcess } from 'child_process'; | ||
import { ChildProcess, SpawnOptions } from 'child_process'; | ||
import { GitExecutorResult } from '../types'; | ||
@@ -13,2 +13,6 @@ declare type SimpleGitTaskPluginContext = { | ||
}; | ||
'spawn.options': { | ||
data: Partial<SpawnOptions>; | ||
context: SimpleGitTaskPluginContext & {}; | ||
}; | ||
'spawn.after': { | ||
@@ -15,0 +19,0 @@ data: void; |
@@ -115,7 +115,7 @@ "use strict"; | ||
const outputLogger = logger.sibling('output'); | ||
const spawnOptions = { | ||
const spawnOptions = this._plugins.exec('spawn.options', { | ||
cwd: this.cwd, | ||
env: this.env, | ||
windowsHide: true, | ||
}; | ||
}, pluginContext(task, task.commands)); | ||
return new Promise((done) => { | ||
@@ -122,0 +122,0 @@ const stdOut = []; |
/// <reference types="node" /> | ||
import { SpawnOptions } from 'child_process'; | ||
import { SimpleGitTask } from './tasks'; | ||
@@ -68,2 +69,3 @@ import { SimpleGitProgressEvent } from './handlers'; | ||
}; | ||
spawnOptions: Pick<SpawnOptions, 'uid' | 'gid'>; | ||
} | ||
@@ -70,0 +72,0 @@ /** |
@@ -39,2 +39,6 @@ /// <reference types="node" /> | ||
export declare function bufferToString(input: Buffer | Buffer[]): string; | ||
/** | ||
* Get a new object from a source object with only the listed properties. | ||
*/ | ||
export declare function pick(source: Record<string, any>, properties: string[]): any; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bufferToString = exports.prefixedArray = exports.asNumber = exports.asStringArray = exports.asArray = exports.objectToString = exports.remove = exports.including = exports.append = exports.folderExists = exports.forEachLineWithContent = exports.toLinesWithContent = exports.last = exports.first = exports.splitOn = exports.isUserFunction = exports.asFunction = exports.NOOP = void 0; | ||
exports.pick = exports.bufferToString = exports.prefixedArray = exports.asNumber = exports.asStringArray = exports.asArray = exports.objectToString = exports.remove = exports.including = exports.append = exports.folderExists = exports.forEachLineWithContent = exports.toLinesWithContent = exports.last = exports.first = exports.splitOn = exports.isUserFunction = exports.asFunction = exports.NOOP = void 0; | ||
const file_exists_1 = require("@kwsites/file-exists"); | ||
@@ -134,2 +134,9 @@ const NOOP = () => { | ||
exports.bufferToString = bufferToString; | ||
/** | ||
* Get a new object from a source object with only the listed properties. | ||
*/ | ||
function pick(source, properties) { | ||
return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {})); | ||
} | ||
exports.pick = pick; | ||
//# sourceMappingURL=util.js.map |
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
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
385988
268
5748
828