From 58d905e0e30b4b4f7ac2e4e59307856575f69aa6 Mon Sep 17 00:00:00 2001 From: Henric Trotzig Date: Tue, 16 Jan 2024 11:59:20 +0100 Subject: [PATCH] Add debug log for full build command So that this is easier to debug. --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8c59668..b363ff7 100644 --- a/index.js +++ b/index.js @@ -6,8 +6,7 @@ const path = require('path'); const Archiver = require('archiver'); const rimraf = require('rimraf'); -const getStorybookVersionFromPackageJson = - require('./getStorybookVersionFromPackageJson'); +const getStorybookVersionFromPackageJson = require('./getStorybookVersionFromPackageJson'); const { HAPPO_DEBUG, HAPPO_STORYBOOK_BUILD_COMMAND } = process.env; @@ -101,6 +100,12 @@ function buildStorybook({ configDir, staticDir, outputDir }) { params.push(staticDir); } const binary = fs.existsSync('yarn.lock') ? 'yarn' : 'npx'; + + if (HAPPO_DEBUG) { + console.log( + `[happo] Using build command \`${binary} ${params.join(' ')}\``, + ); + } const spawned = spawn(binary, params, { stdio: 'inherit', shell: process.platform == 'win32',