feat(help): link to the versioned docs

This commit is contained in:
Zoltan Kochan
2021-03-07 00:42:11 +02:00
parent ac80ca1208
commit f73f35e200

View File

@@ -1,3 +1,4 @@
import pnpmManifest from '@pnpm/cli-meta'
import getConfig from './getConfig'
export { getConfig }
@@ -8,4 +9,7 @@ export * from './readProjectManifest'
export * from './recursiveSummary'
export * from './style'
export const docsUrl = (cmd: string) => `https://pnpm.js.org/cli/${cmd}`
export const docsUrl = (cmd: string) => {
const [pnpmMajorVersion] = pnpmManifest.version.split('.')
return `https://pnpm.js.org/${pnpmMajorVersion}.x/cli/${cmd}`
}