Skip to main content

Function: createVcsAdapter()

createVcsAdapter(cwd?, providers?): Promise<VcsAdapter>

Defined in: packages/core/src/composition/vcs-adapter.ts:59

Auto-detects the active VCS in the given directory and returns the corresponding VcsAdapter implementation.

Probes providers in the supplied order. Falls back to NullVcsAdapter when no provider detects a VCS.

Parameters

cwd?

string

Directory to probe; defaults to process.cwd()

providers?

readonly VcsProvider[] = BUILTIN_VCS_PROVIDERS

Detection providers in priority order

Returns

Promise<VcsAdapter>

A VcsAdapter for the detected VCS