Skip to content

Commit

Permalink
Merge pull request #149 from amenella/fix-debug-option-for-esm
Browse files Browse the repository at this point in the history
fix: fix undefined '__dirname' (in ES module) for debug option
  • Loading branch information
pmowrer authored Feb 5, 2024
2 parents dbf89dc + 66ccbec commit a734b06
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 a734b06

Please sign in to comment.