mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-03 05:28:39 -04:00
fix: installation of tarball from subfolder
Ref https://github.com/pnpm/supi/issues/10
This commit is contained in:
@@ -127,6 +127,7 @@ export default async function fetch (
|
||||
pkg,
|
||||
storeIndex: options.storeIndex,
|
||||
verifyStoreIntegrity: options.verifyStoreIntegrity,
|
||||
prefix: options.prefix,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -156,6 +157,7 @@ function fetchToStore (opts: {
|
||||
pkg?: Package,
|
||||
storeIndex: Store,
|
||||
verifyStoreIntegrity: boolean,
|
||||
prefix: string,
|
||||
}): {
|
||||
fetchingFiles: Promise<PackageContentInfo>,
|
||||
fetchingPkg: Promise<Package>,
|
||||
@@ -228,6 +230,7 @@ function fetchToStore (opts: {
|
||||
pkgId: opts.pkgId,
|
||||
storePath: opts.storePath,
|
||||
offline: opts.offline,
|
||||
prefix: opts.prefix,
|
||||
})
|
||||
}(),
|
||||
// removing only the folder with the unpacked files
|
||||
|
||||
@@ -20,6 +20,7 @@ export type FetchOptions = {
|
||||
got: Got,
|
||||
storePath: string,
|
||||
offline: boolean,
|
||||
prefix: string,
|
||||
}
|
||||
|
||||
export type PackageDist = {
|
||||
@@ -79,7 +80,7 @@ function execGit (args: string[], opts?: Object) {
|
||||
|
||||
export function fetchFromTarball (dir: string, dist: PackageDist, opts: FetchOptions) {
|
||||
if (dist.tarball.startsWith('file:')) {
|
||||
dist = Object.assign({}, dist, {tarball: dist.tarball.slice(5)})
|
||||
dist = Object.assign({}, dist, {tarball: path.join(opts.prefix, dist.tarball.slice(5))})
|
||||
return fetchFromLocalTarball(dir, dist)
|
||||
} else {
|
||||
return fetchFromRemoteTarball(dir, dist, opts)
|
||||
|
||||
Reference in New Issue
Block a user