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

Commit

Permalink
Show correct path in cache ls
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 21, 2012
1 parent 3dca246 commit e8c89c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cache.js
Expand Up @@ -120,9 +120,13 @@ function ls (args, cb) {
output = output || require("./utils/output.js")
args = args.join("/").split("@").join("/")
if (args.substr(-1) === "/") args = args.substr(0, args.length - 1)
var prefix = npm.config.get("cache")
if (0 === prefix.indexOf(process.env.HOME)) {
prefix = "~" + prefix.substr(process.env.HOME.length)
}
ls_(args, npm.config.get("depth"), function(er, files) {
output.write(files.map(function (f) {
return path.join("~/.npm", f)
return path.join(prefix, f)
}).join("\n").trim(), function (er) {
return cb(er, files)
})
Expand Down

0 comments on commit e8c89c3

Please sign in to comment.