Only remove 'git+' if 'git' type matches

This commit is contained in:
Jessica Lord
2015-05-12 12:13:14 -07:00
parent 4b9718f5cf
commit d7aa2fc2c4
2 changed files with 4 additions and 2 deletions

View File

@@ -46,7 +46,8 @@ module.exports = (grunt) ->
invalidPackages = true
grunt.log.error("#{metadata.name}: #{msg}")
normalizePackageData metadata, reportPackageError, true
metadata.repository.url ?= metadata.repository.url?.replace(/^git\+/, '')
if metadata.repository.type is 'git'
metadata.repository.url ?= metadata.repository.url?.replace(/^git\+/, '')
moduleCache = metadata._atomModuleCache ? {}

View File

@@ -29,7 +29,8 @@ class Package
unless metadata?._id
normalizePackageData ?= require 'normalize-package-data'
normalizePackageData(metadata)
metadata.repository.url = metadata.repository.url.replace(/^git\+/, '')
if metadata.repository.type is 'git'
metadata.repository.url = metadata.repository.url.replace(/^git\+/, '')
metadata
@loadMetadata: (packagePath, ignoreErrors=false) ->