Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
git: use paths as presented by user
Browse files Browse the repository at this point in the history
* Save the lightest-possibly normalized URL into `package.json` and
  package.json _from fields, because read-package-json, read-installed,
  and the cache all know how to handle them now.
* Add support for github:, gist:, bitbucket:, and gitlab: shortcut
  syntax. GitHub shortcuts will continue to be normalized to org/repo
  instead of being saved with a github: prefix (for now).
* If presented with shortcuts, try cloning via git, SSH, and HTTPS (in
  that order, skipping any methods that aren't supported by a given
  hosting provider).
* No longer prompt for credentials -- it didn't work right with the
  spinner, and wasn't guaranteed to work anyway. We may experiment with
  doing this a better way in the future. Users can override this by
  setting GIT_ASKPASS in their environment if they want to experiment
  with interactive cloning, but should also set --no-spin on the npm
  command line (or run `npm config set spin=false`).
  • Loading branch information
othiym23 committed Apr 10, 2015
1 parent 33d1420 commit 6b0f588
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 391 deletions.
9 changes: 1 addition & 8 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ var npm = require("./npm.js")
, addLocal = require("./cache/add-local.js")
, addRemoteTarball = require("./cache/add-remote-tarball.js")
, addRemoteGit = require("./cache/add-remote-git.js")
, maybeGithub = require("./cache/maybe-github.js")
, inflight = require("inflight")
, realizePackageSpecifier = require("realize-package-specifier")
, npa = require("npm-package-arg")
Expand Down Expand Up @@ -296,14 +295,8 @@ function add (args, where, cb) {
})
break
case "git":
addRemoteGit(p.spec, false, cb)
break
case "hosted":
if (p.hosted.type === "github") {
maybeGithub(p.rawSpec, cb)
} else {
addRemoteGit(p.spec, false, cb)
}
addRemoteGit(p.rawSpec, cb)
break
default:
if (p.name) return addNamed(p.name, p.spec, null, cb)
Expand Down
Loading

0 comments on commit 6b0f588

Please sign in to comment.