Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
inflate-shrinkwrap: For git changelings use version as resolved
Credit: @iarna
PR-URL: #20390
Reviewed-By: @zkat
  • Loading branch information
iarna committed Apr 20, 2018
1 parent 2facb35 commit 9c1eb945be566e24cbbbf186b0437bdec4be53fc
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/install/inflate-shrinkwrap.js
@@ -16,6 +16,7 @@ const path = require('path')
const isRegistry = require('../utils/is-registry.js')
const hasModernMeta = require('./has-modern-meta.js')
const ssri = require('ssri')
const npa = require('npm-package-arg')

module.exports = function (tree, sw, opts, finishInflating) {
if (!fetchPackageMetadata) {
@@ -108,13 +109,18 @@ function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts)
}
}

function isGit (sw) {
const version = npa.resolve(sw.name, sw.version)
return (version && version.type === 'git')
}

function makeFakeChild (name, topPath, tree, sw, requested) {
const from = sw.from || requested.raw
const pkg = {
name: name,
version: sw.version,
_id: name + '@' + sw.version,
_resolved: sw.resolved,
_resolved: sw.resolved || (isGit(sw) && sw.version),
_requested: requested,
_optional: sw.optional,
_development: sw.dev,

0 comments on commit 9c1eb94

Please sign in to comment.