Skip to content

Commit

Permalink
Add debug log for full build command
Browse files Browse the repository at this point in the history
So that this is easier to debug.
  • Loading branch information
trotzig committed Jan 16, 2024
1 parent ccc6269 commit 58d905e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 58d905e

Please sign in to comment.