diff --git a/src/log-plugin-version.js b/src/log-plugin-version.js index 7df61eb..e8cf3e9 100644 --- a/src/log-plugin-version.js +++ b/src/log-plugin-version.js @@ -1,4 +1,5 @@ -import { resolve } from 'path'; +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; import readPkg from 'read-pkg'; import createDebug from 'debug'; @@ -6,6 +7,7 @@ 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); }