Skip to content

Commit ab4d2df

Browse files
committed
fix: update cwd to use dirname for retrieving remote repository URL
1 parent c97ebec commit ab4d2df

File tree

1 file changed

+2
-1
lines changed
  • packages/nimiq-vitepress-theme/src

1 file changed

+2
-1
lines changed

packages/nimiq-vitepress-theme/src/vite.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Plugin } from 'vite'
22
import { exec } from 'node:child_process'
33
import { promisify } from 'node:util'
44
import { GitChangelog } from '@nolebase/vitepress-plugin-git-changelog/vite'
5+
import { dirname } from 'pathe'
56
import { groupIconVitePlugin } from './code-groups/vite'
67

78
export interface NimiqVitepressVitePluginOptions {
@@ -15,7 +16,7 @@ export async function NimiqVitepressVitePlugin(_options: NimiqVitepressVitePlugi
1516

1617
const externalPlugins: Plugin[] = []
1718

18-
const repoURL = await execAsync('git config --get remote.origin.url', { cwd: __dirname }).then(result => result.stdout.trim()).catch(() => null)
19+
const repoURL = await execAsync('git config --get remote.origin.url', { cwd: dirname('.') }).then(result => result.stdout.trim()).catch(() => null)
1920
if (repoURL)
2021
externalPlugins.push(GitChangelog({ repoURL }))
2122

0 commit comments

Comments
 (0)