Skip to content

Commit

Permalink
fix: fixed resolving repository root
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Apr 17, 2022
1 parent 867abe1 commit 7fb9f72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/commands/update-changelog.ts
Expand Up @@ -2,7 +2,7 @@ import { doActionAndLog, getGitRootDirection } from '#lib/utils';
import type { OptionValues } from 'commander';
import { execa } from 'execa';

export function updateChangelog(options: OptionValues, tag: string) {
export async function updateChangelog(options: OptionValues, tag: string) {
return doActionAndLog(
'Updating Changelog',
execa('git-cliff', [
Expand All @@ -14,7 +14,7 @@ export function updateChangelog(options: OptionValues, tag: string) {
'-c',
'./cliff.toml',
'-r',
`${getGitRootDirection() || '.'}/`,
`${(await getGitRootDirection()) || '.'}/`,
'--include-path',
`"${options.packagePath}/*"`
])
Expand Down
5 changes: 1 addition & 4 deletions src/lib/utils.ts
Expand Up @@ -24,10 +24,7 @@ export async function readJson<T>(pathLike: PathLike): Promise<T> {
}

export async function getGitRootDirection() {
const repositoryRoot = await doActionAndLog(
'Retrieving the root directory of the Git repository',
execa('git', ['rev-parse', '--show-prefix'], { encoding: 'utf-8' })
);
const repositoryRoot = await execa('git', ['rev-parse', '--show-prefix'], { encoding: 'utf-8' });

return repositoryRoot.stdout
.split('/')
Expand Down

0 comments on commit 7fb9f72

Please sign in to comment.