Permalink
Browse files

Make force clobber things

  • Loading branch information...
1 parent b246b96 commit 379314e2405480807159cd0ec8d25a970cea2733 @isaacs isaacs committed Mar 21, 2011
Showing with 3 additions and 1 deletion.
  1. +2 −0 lib/utils/link.js
  2. +1 −1 lib/utils/rm-rf.js
View
@@ -9,6 +9,7 @@ var fs = require("./graceful-fs")
, log = require("./log")
, path = require("path")
, relativize = require("./relativize")
+ , npm = require("../../npm")
function linkIfExists (from, to, gently, cb) {
fs.stat(from, function (er) {
@@ -19,6 +20,7 @@ function linkIfExists (from, to, gently, cb) {
function link (from, to, gently, cb) {
if (typeof cb !== "function") cb = gently, gently = null
+ if (npm.config.get("force")) gently = false
chain
( [fs, "stat", from]
, [rm, to, gently]
View
@@ -56,7 +56,7 @@ function rm (p, gently, cb_) {
}
function clobberFail (p, cb) {
- var er = new Error("Refusing to delete non-npm file")
+ var er = new Error("Refusing to delete non-npm file (override with --force)")
er.errno = constants.EEXIST
er.path = p
return cb(er)

0 comments on commit 379314e

Please sign in to comment.