diff options
author | isaacs <i@izs.me> | 2012-03-27 11:23:32 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-03-27 11:23:32 +0400 |
commit | b3a77553371fcf3e7db2e518f662d2523bff43eb (patch) | |
tree | 7d090a3c801fece56772f7c00616b18d0e0b25e5 /lib/npm.js | |
parent | 7fb3d9aaf5e9617269245876a4172b4919873a16 (diff) |
Remove some unnecessary rename hacks
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/npm.js b/lib/npm.js index 3e4addf64..c314b3ec2 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -40,30 +40,6 @@ npm.ECYCLE = {} npm.ENOTSUP = {} npm.EBADPLATFORM = {} -// HACK for windows -if (process.platform === "win32") { - // stub in unavailable methods from process and fs binding - if (!process.getuid) process.getuid = function() {} - if (!process.getgid) process.getgid = function() {} - var fsBinding = process.binding("fs") - if (!fsBinding.chown) fsBinding.chown = function() { - var cb = arguments[arguments.length - 1] - if (typeof cb == "function") cb() - } - - // patch rename/renameSync, but this should really be fixed in node - var _fsRename = fs.rename - , _fsPathPatch - _fsPathPatch = function(p) { - return p && p.replace(/\\/g, "/") || p; - } - fs.rename = function(p1, p2) { - arguments[0] = _fsPathPatch(p1) - arguments[1] = _fsPathPatch(p2) - return _fsRename.apply(fs, arguments); - } -} - try { // startup, ok to do this synchronously var j = JSON.parse(fs.readFileSync( |