diff options
author | isaacs <i@izs.me> | 2010-05-03 11:01:42 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-03 11:01:42 +0400 |
commit | 85aaa4eca634d73c523d194d09eb2a6bb85e4279 (patch) | |
tree | 8c745aa5d028f0209061ee25a68f62b011999bf1 /install-docs.js | |
parent | 8848fa67cc69edcc534f5d815bbee34d62eeea99 (diff) |
Getting it sorted. Use the proper installPrefix, tidy up some path issues.
Diffstat (limited to 'install-docs.js')
-rw-r--r-- | install-docs.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/install-docs.js b/install-docs.js index fbc0ccd85..aeee5f8c7 100644 --- a/install-docs.js +++ b/install-docs.js @@ -15,17 +15,17 @@ log(event, "install docs") fs.readdir(path.join(process.cwd(), "man"), function (er, docs) { log(path.join(process.cwd(), "man"), "readdir") - if (er) throw er + if (er) throw new Error(er) ;(function R (doc) { if (!doc) return + var target = path.join(process.installPrefix, "share/man/man1", "npm-"+doc) switch (event) { case "activate": - var target = path.join(process.prefix, "share/man/man1/", doc) rm( target , function () { fs.symlink ( path.join(process.cwd(), "man", doc) - , path.join(target) + , target , function (er, ok) { if (er) throw er R(docs.pop()) @@ -35,9 +35,7 @@ fs.readdir(path.join(process.cwd(), "man"), function (er, docs) { ) break case "deactivate": - rm( path.join(process.prefix, "share/man/man1/", doc) - , function (er) { R(docs.pop()) } - ) + rm( target, function (er) { R(docs.pop()) }) break default: throw new Error("invalid state"); break } |