From 2a9a1b43c1af1e33e267a1860b7f6f0a4257c4bb Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 2 May 2023 12:39:27 -0400 Subject: [PATCH] chore: Improve release script logging Signed-off-by: Sebastian Malton --- .github/workflows/daily-alpha.yml | 1 - packages/release-tool/src/index.ts | 24 +++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/daily-alpha.yml b/.github/workflows/daily-alpha.yml index 771d652c68..ff48f37922 100644 --- a/.github/workflows/daily-alpha.yml +++ b/.github/workflows/daily-alpha.yml @@ -25,7 +25,6 @@ jobs: - name: Create PR run: | - git fetch npm run create-release-pr env: BUMP_PACKAGE_ARGS: -- --conventional-commits --conventional-prerelease --yes diff --git a/packages/release-tool/src/index.ts b/packages/release-tool/src/index.ts index f8ef90e370..8ceaa64f43 100755 --- a/packages/release-tool/src/index.ts +++ b/packages/release-tool/src/index.ts @@ -5,7 +5,7 @@ */ import assert from "assert"; import chalk from "chalk"; -import child_process, { spawn } from "child_process"; +import child_process, { ExecFileOptions, spawn as _spawn } from "child_process"; import { readFile } from "fs/promises"; import inquirer from "inquirer"; import { createInterface, ReadLine } from "readline"; @@ -15,8 +15,26 @@ import { promisify } from "util"; type SemVer = semver.SemVer; const { SemVer } = semver; -const exec = promisify(child_process.exec); -const execFile = promisify(child_process.execFile); +const _exec = promisify(child_process.exec); +const _execFile = promisify(child_process.execFile); + +const exec = ((cmd, ...args) => { + console.log("EXEC", cmd); + + return _exec(cmd, ...args as any[]); +}) as typeof _exec; + +const execFile = (file: string, args: string[], opts?: ExecFileOptions) => { + console.log("EXEC", file, args); + + return _execFile(file, args, opts); +}; + +const spawn = ((file, ...args) => { + console.log("SPAWN", file); + + return _spawn(file, ...args as any[]); +}) as typeof _spawn; async function pipeExecFile(file: string, args: string[], opts?: { stdin: string }) { const p = execFile(file, args);