Skip to content

Commit

Permalink
Merge pull request #40 from ZettaScaleLabs/fix-maxbuffer-exceeded
Browse files Browse the repository at this point in the history
fix: Increase child process `maxBuffer` size from 1MB to 10MB
  • Loading branch information
gabrik authored Mar 18, 2024
2 parents 6afc684 + dc083af commit c520011
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion dist/build-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128144,8 +128144,8 @@ var external_child_process_ = __nccwpck_require__(32081);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -128164,6 +128164,7 @@ function sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/build-crates-standalone-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128143,8 +128143,8 @@ var external_child_process_ = __nccwpck_require__(32081);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -128163,6 +128163,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/publish-crates-cargo-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82002,8 +82002,8 @@ function stringify(obj) {
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -82022,6 +82022,7 @@ function sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/publish-crates-debian-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127178,8 +127178,8 @@ var external_os_ = __nccwpck_require__(22037);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -127198,6 +127198,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/publish-crates-eclipse-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127178,8 +127178,8 @@ var external_os_ = __nccwpck_require__(22037);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -127198,6 +127198,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/publish-crates-github-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127174,8 +127174,8 @@ var external_os_ = __nccwpck_require__(22037);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -127194,6 +127194,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/publish-crates-homebrew-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127178,8 +127178,8 @@ var external_os_ = __nccwpck_require__(22037);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -127198,6 +127198,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
3 changes: 2 additions & 1 deletion dist/tag-crates-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -80883,8 +80883,8 @@ var external_os_ = __nccwpck_require__(2037);
;// CONCATENATED MODULE: ./src/command.ts


// import * as path from "path";

const MAX_BUFFER = 10 * 1024 * 1024;
function command_sh(cmd, options) {
options = options != null ? options : {};
options.env = options.env != null ? options.env : {};
Expand All @@ -80903,6 +80903,7 @@ function command_sh(cmd, options) {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});
if (returns.stdout != "") {
lib_core.info(`\u001b[1mstdout:\u001b[0m`);
Expand Down
4 changes: 3 additions & 1 deletion src/command.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { spawnSync } from "child_process";
import * as core from "@actions/core";
// import * as path from "path";
import * as os from "os";

const MAX_BUFFER = 10 * 1024 * 1024;

export type CommandOptions = {
env?: NodeJS.ProcessEnv;
cwd?: string;
Expand Down Expand Up @@ -30,6 +31,7 @@ export function sh(cmd: string, options?: CommandOptions): string {
encoding: "utf-8",
cwd: options.cwd,
input: options.input,
maxBuffer: MAX_BUFFER,
});

if (returns.stdout != "") {
Expand Down

0 comments on commit c520011

Please sign in to comment.