Skip to content

Commit 3c786a6

Browse files
committed
fix: feedback v2
1 parent cf4c8e4 commit 3c786a6

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

packages/apply-release-plan/src/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export default async function applyReleasePlan(
6868
releasePlan: ReleasePlan,
6969
packages: Packages,
7070
config: Config = defaultConfig,
71-
snapshot?: string | boolean
71+
snapshot?: string | boolean,
72+
contextDir?: string
7273
) {
7374
let cwd = packages.root.dir;
7475

@@ -97,7 +98,8 @@ export default async function applyReleasePlan(
9798
releasesWithPackage,
9899
changesets,
99100
config,
100-
cwd
101+
cwd,
102+
contextDir
101103
);
102104

103105
if (releasePlan.preState !== undefined && snapshot === undefined) {
@@ -189,7 +191,8 @@ async function getNewChangelogEntry(
189191
releasesWithPackage: ModCompWithPackage[],
190192
changesets: NewChangeset[],
191193
config: Config,
192-
cwd: string
194+
cwd: string,
195+
contextDir = __dirname
193196
) {
194197
if (!config.changelog) {
195198
return Promise.resolve(
@@ -212,7 +215,7 @@ async function getNewChangelogEntry(
212215
try {
213216
changelogPath = resolveFrom(changesetPath, config.changelog[0]);
214217
} catch {
215-
changelogPath = resolveFrom(__dirname, config.changelog[0]);
218+
changelogPath = resolveFrom(contextDir, config.changelog[0]);
216219
}
217220

218221
let possibleChangelogFunc = require(changelogPath);

packages/cli/src/commands/version/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ export default async function version(
8585
releasePlan,
8686
packages,
8787
releaseConfig,
88-
options.snapshot
88+
options.snapshot,
89+
__dirname
8990
);
9091

9192
const [{ getVersionMessage }, commitOpts] = getCommitFunctions(

0 commit comments

Comments
 (0)