Skip to content

Commit

Permalink
Use readFileSync rather than async import to avoid import caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Feb 15, 2024
1 parent a9fef22 commit 54b3af6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/publish-action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cpy from 'cpy';
import { $ } from 'execa';
import { readFileSync } from 'fs';
import tmp from 'tmp-promise';

const copy = (globs, ...args) => {
Expand Down Expand Up @@ -65,7 +66,7 @@ const publishAction = async ({ major, version, repo }) => {
return;
}

const { default: pkg } = await import('../package.json', { assert: { type: 'json' } });
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));

const [, major, minor, patch, tag] = pkg.version.match(/(\d+)\.(\d+)\.(\d+)-*(\w+)?/) || [];
if (!major || !minor || !patch) {
Expand Down

0 comments on commit 54b3af6

Please sign in to comment.