diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index 7cb9b60..495b2e6 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -127551,11 +127551,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127567,11 +127567,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index 2d7a6d7..6f08d8c 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -127536,11 +127536,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127552,11 +127552,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/bump-crates-main.js b/dist/bump-crates-main.js index ccf6b76..8536337 100644 --- a/dist/bump-crates-main.js +++ b/dist/bump-crates-main.js @@ -81257,11 +81257,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -81273,11 +81273,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/create-release-branch-main.js b/dist/create-release-branch-main.js index 1e49cf9..6d0fa45 100644 --- a/dist/create-release-branch-main.js +++ b/dist/create-release-branch-main.js @@ -24749,11 +24749,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; lib_core.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,external_child_process_namespaceObject.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -24765,11 +24765,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { lib_core.info(`\u001b[1mstdout:\u001b[0m`); lib_core.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { lib_core.info(`\u001b[1mstderr:\u001b[0m`); lib_core.info(returns.stderr); } diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index a7b08c4..3f46404 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -81145,11 +81145,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -81161,11 +81161,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index f4b4e95..50a5c18 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -127531,11 +127531,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127547,11 +127547,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } @@ -127736,9 +127736,9 @@ async function main(input) { (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("sudo apt-get install -y dpkg-dev"); await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(packagesPath, (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`dpkg-scanpackages --multiversion ${input.version}`)); // NOTE: An unzipped package index is necessary for apt-get to recognize the - // local repository created below. By redirecting the output we also avoid breaking the Github webUI displaying too much data. - (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cat .Packages-* > ${allPackagesPath}`); - const packages = await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(allPackagesPath, "utf8"); + // local repository created below + const packages = (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cat .Packages-*`, { quiet: true }); + await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(allPackagesPath, packages); await fs_promises__WEBPACK_IMPORTED_MODULE_0__.writeFile(allPackagesGzippedPath, await gzip(packages)); (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)("ls -R"); _actions_core__WEBPACK_IMPORTED_MODULE_2__.info(`Adding a local Debian repository at ${process.cwd()}`); diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index d97af27..5e3a63b 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -127633,11 +127633,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127649,11 +127649,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index c49d065..9bf1bea 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -127612,11 +127612,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127628,11 +127628,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index 85981f2..bac65bf 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -127537,11 +127537,11 @@ function sh(cmd, options) { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = (0,child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -127553,11 +127553,11 @@ function sh(cmd, options) { input: options.input, maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstdout:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(`\u001b[1mstderr:\u001b[0m`); _actions_core__WEBPACK_IMPORTED_MODULE_1__.info(returns.stderr); } diff --git a/src/command.ts b/src/command.ts index 0fbaf9e..c03cd0f 100644 --- a/src/command.ts +++ b/src/command.ts @@ -8,6 +8,7 @@ export type CommandOptions = { cwd?: string; check?: boolean; input?: string; + quiet?: boolean; }; export function sh(cmd: string, options?: CommandOptions): string { @@ -16,13 +17,13 @@ export function sh(cmd: string, options?: CommandOptions): string { options.cwd = options.cwd != null ? options.cwd : "."; options.check = options.check != null ? options.check : true; options.input = options.input != null ? options.input : ""; + options.quiet = options.quiet != null ? options.quiet : false; core.startGroup(`\u001b[1m\u001b[35m${cmd}\u001b[0m`); const returns = spawnSync(cmd, { // NOTE: Environment variables defined in `options.env` take precedence over - // the parent process's environment, thus the destructuring is order is - // important + // the parent process's environment, thus the destructuring order is important env: { ...process.env, ...options.env, @@ -35,12 +36,12 @@ export function sh(cmd: string, options?: CommandOptions): string { maxBuffer: MAX_BUFFER, }); - if (returns.stdout != "") { + if (returns.stdout != "" && !options.quiet) { core.info(`\u001b[1mstdout:\u001b[0m`); core.info(returns.stdout); } - if (returns.stderr != "") { + if (returns.stderr != "" && !options.quiet) { core.info(`\u001b[1mstderr:\u001b[0m`); core.info(returns.stderr); } diff --git a/src/publish-crates-debian.ts b/src/publish-crates-debian.ts index ead6cf3..dc8b1cb 100644 --- a/src/publish-crates-debian.ts +++ b/src/publish-crates-debian.ts @@ -87,9 +87,9 @@ export async function main(input: Input) { await fs.writeFile(packagesPath, sh(`dpkg-scanpackages --multiversion ${input.version}`)); // NOTE: An unzipped package index is necessary for apt-get to recognize the - // local repository created below. By redirecting the output we also avoid breaking the Github webUI displaying too much data. - sh(`cat .Packages-* > ${allPackagesPath}`); - const packages = await fs.readFile(allPackagesPath, "utf8"); + // local repository created below + const packages = sh(`cat .Packages-*`, {quiet: true}); + await fs.writeFile(allPackagesPath, packages); await fs.writeFile(allPackagesGzippedPath, await gzip(packages)); sh("ls -R");