Skip to content

Commit

Permalink
fix publish command (#171)
Browse files Browse the repository at this point in the history
Signed-off-by: Kangrui Ye <[email protected]>
  • Loading branch information
strawberry-choco authored Dec 13, 2023
1 parent bec7c6d commit 5ea008f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import devkit from '@nx/devkit';
import {execSync} from 'child_process';
import chalk from 'chalk';
import {writeFileSync} from 'node:fs';

function invariant(condition, message) {
if (!condition) {
Expand Down Expand Up @@ -42,7 +43,8 @@ invariant(actualOutputPath, `Could not find "build.options.outputPath" of projec
process.chdir(actualOutputPath);

// needed, so it does not complain this output dir for not being in the project workspace
execSync(`volta run --yarn ${packageJson.volta.yarn} yarn install`);
writeFileSync('yarn.lock', '');
execSync(`volta run --yarn ${packageJson.volta.yarn} yarn install --mode=update-lockfile`, {encoding: 'utf8'});

// Execute "yarn npm publish" to publish
execSync(`volta run --yarn ${packageJson.volta.yarn} yarn npm publish`);
execSync(`volta run --yarn ${packageJson.volta.yarn} yarn npm publish`, {encoding: 'utf8'});

0 comments on commit 5ea008f

Please sign in to comment.