fix(schema): resolve workspaceDir to closest git config

This commit is contained in:
Daniel Roe 2025-03-04 11:57:59 +00:00
parent 34ddc2d2f9
commit 7a2fbce01a
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -69,7 +69,12 @@ export default defineResolvers({
workspaceDir: {
$resolve: async (val, get) => {
const rootDir = await get('rootDir')
return val && typeof val === 'string' ? resolve(rootDir, val) : await findWorkspaceDir(rootDir).catch(() => rootDir)
return val && typeof val === 'string'
? resolve(rootDir, val)
: await findWorkspaceDir(rootDir, {
gitConfig: 'closest',
try: true,
}).catch(() => rootDir)
},
},