Skip to content

Commit

Permalink
fix: fix undefined '__dirname' (in ES module) for debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Menella committed Jan 30, 2024
1 parent dbf89dc commit 66ccbec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/log-plugin-version.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { resolve } from 'path';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import readPkg from 'read-pkg';
import createDebug from 'debug';

const debug = createDebug('semantic-release:monorepo');

const logPluginVersion = type => plugin => async (pluginConfig, config) => {
if (config.options.debug) {
const __dirname = dirname(fileURLToPath(import.meta.url));
const { version } = await readPkg(resolve(__dirname, '../'));
debug('Running %o version %o', type, version);
}
Expand Down

0 comments on commit 66ccbec

Please sign in to comment.