mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-23 17:41:50 -04:00
18 lines
604 B
TypeScript
18 lines
604 B
TypeScript
import path = require('path')
|
|
import pFilter = require('p-filter')
|
|
import {PnpmOptions} from '../types'
|
|
import extendOptions from './extendOptions'
|
|
import getContext from './getContext'
|
|
import untouched from '../pkgIsUntouched'
|
|
|
|
export default async function (maybeOpts: PnpmOptions) {
|
|
const opts = extendOptions(maybeOpts)
|
|
const ctx = await getContext(opts)
|
|
if (!ctx.shrinkwrap) return []
|
|
|
|
const pkgPaths = Object.keys(ctx.shrinkwrap.packages || {})
|
|
.map(pkgPath => path.join(ctx.storePath, pkgPath))
|
|
|
|
return await pFilter(pkgPaths, async (pkgPath: string) => !await untouched(pkgPath))
|
|
}
|