Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the way npm help works, so that it will work with man programs…

… that stubbornly refuse to take a troff file as an argument

That is, make it work on Solaris.
  • Loading branch information...
commit dbee5c3b14f10fac8b15e661a8e5ed72d4e147c0 1 parent f9071cf
@isaacs isaacs authored
Showing with 19 additions and 11 deletions.
  1. +11 −8 Makefile
  2. +7 −2 lib/help.js
  3. 0  {man → man1}/activate.1
  4. 0  {man → man1}/adduser.1
  5. 0  {man → man1}/build.1
  6. 0  {man → man1}/bundle.1
  7. 0  {man → man1}/cache.1
  8. 0  {man → man1}/coding-style.1
  9. 0  {man → man1}/config.1
  10. 0  {man → man1}/deactivate.1
  11. 0  {man → man1}/developers.1
  12. 0  {man → man1}/folders.1
  13. 0  {man → man1}/future-ideas/deploy.1
  14. 0  {man → man1}/future-ideas/remote.1
  15. 0  {man → man1}/future-ideas/site.1
  16. 0  {man → man1}/help.1
  17. 0  {man → man1}/install.1
  18. 0  {man → man1}/json.1
  19. 0  {man → man1}/link.1
  20. 0  {man → man1}/list.1
  21. 0  {man → man1}/ln.1
  22. 0  {man → man1}/ls.1
  23. 0  {man → man1}/npm.1
  24. 0  {man → man1}/owner.1
  25. 0  {man → man1}/publish.1
  26. 0  {man → man1}/rebuild.1
  27. 0  {man → man1}/restart.1
  28. 0  {man → man1}/rm.1
  29. 0  {man → man1}/scripts.1
  30. 0  {man → man1}/start.1
  31. 0  {man → man1}/stop.1
  32. 0  {man → man1}/tag.1
  33. 0  {man → man1}/test.1
  34. 0  {man → man1}/uninstall.1
  35. 0  {man → man1}/unpublish.1
  36. 0  {man → man1}/update.1
  37. 0  {man → man1}/view.1
  38. +1 −1  package.json
View
19 Makefile
@@ -1,10 +1,10 @@
docs = $(shell find doc -name '*.md' \
|sed 's|.md|.1|g' \
- |sed 's|doc/|man/|g' \
+ |sed 's|doc/|man1/|g' \
)
doc_subfolders = $(shell find doc -type d \
- |sed 's|doc/|man/|g' \
+ |sed 's|doc/|man1/|g' \
)
install:
@@ -23,20 +23,23 @@ uninstall:
node cli.js cache clean
node cli.js rm npm
-man: $(doc_subfolders)
- @if ! test -d man ; then mkdir -p man ; fi
+man: man1
+ @true
+
+man1: $(doc_subfolders)
+ @if ! test -d man1 ; then mkdir -p man1 ; fi
-doc: man $(docs)
+doc: man1 $(docs)
@true
# use `npm install ronn` for this to work.
-man/%.1: doc/%.md
+man1/%.1: doc/%.md
ronn --roff $< > $@
-man/%/: doc/%/
+man1/%/: doc/%/
@if ! test -d $@ ; then mkdir -p $@ ; fi
test:
./test/run.sh
-.PHONY: install install-dev link doc clean uninstall test
+.PHONY: install install-dev link doc clean uninstall test man
View
9 lib/help.js
@@ -7,8 +7,13 @@ module.exports = help
function help (args, cb) {
var section = args.shift() || "help"
- fs.stat(path.join(__dirname, "../man/"+section+".1"), function (e, o) {
+ fs.stat(path.join(__dirname, "../man1/"+section+".1"), function (e, o) {
if (e) return cb(new Error("Help section not found: "+section))
- exec("man", [path.join(__dirname, "../man/"+section+".1")], cb)
+ // function exec (cmd, args, env, takeOver, cb) {
+ var manpath = path.join(__dirname, "..")
+ , env = {}
+ Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] })
+ env.MANPATH = manpath
+ exec("man", [section], env, true, cb)
})
}
View
0  man/activate.1 → man1/activate.1
File renamed without changes
View
0  man/adduser.1 → man1/adduser.1
File renamed without changes
View
0  man/build.1 → man1/build.1
File renamed without changes
View
0  man/bundle.1 → man1/bundle.1
File renamed without changes
View
0  man/cache.1 → man1/cache.1
File renamed without changes
View
0  man/coding-style.1 → man1/coding-style.1
File renamed without changes
View
0  man/config.1 → man1/config.1
File renamed without changes
View
0  man/deactivate.1 → man1/deactivate.1
File renamed without changes
View
0  man/developers.1 → man1/developers.1
File renamed without changes
View
0  man/folders.1 → man1/folders.1
File renamed without changes
View
0  man/future-ideas/deploy.1 → man1/future-ideas/deploy.1
File renamed without changes
View
0  man/future-ideas/remote.1 → man1/future-ideas/remote.1
File renamed without changes
View
0  man/future-ideas/site.1 → man1/future-ideas/site.1
File renamed without changes
View
0  man/help.1 → man1/help.1
File renamed without changes
View
0  man/install.1 → man1/install.1
File renamed without changes
View
0  man/json.1 → man1/json.1
File renamed without changes
View
0  man/link.1 → man1/link.1
File renamed without changes
View
0  man/list.1 → man1/list.1
File renamed without changes
View
0  man/ln.1 → man1/ln.1
File renamed without changes
View
0  man/ls.1 → man1/ls.1
File renamed without changes
View
0  man/npm.1 → man1/npm.1
File renamed without changes
View
0  man/owner.1 → man1/owner.1
File renamed without changes
View
0  man/publish.1 → man1/publish.1
File renamed without changes
View
0  man/rebuild.1 → man1/rebuild.1
File renamed without changes
View
0  man/restart.1 → man1/restart.1
File renamed without changes
View
0  man/rm.1 → man1/rm.1
File renamed without changes
View
0  man/scripts.1 → man1/scripts.1
File renamed without changes
View
0  man/start.1 → man1/start.1
File renamed without changes
View
0  man/stop.1 → man1/stop.1
File renamed without changes
View
0  man/tag.1 → man1/tag.1
File renamed without changes
View
0  man/test.1 → man1/test.1
File renamed without changes
View
0  man/uninstall.1 → man1/uninstall.1
File renamed without changes
View
0  man/unpublish.1 → man1/unpublish.1
File renamed without changes
View
0  man/update.1 → man1/update.1
File renamed without changes
View
0  man/view.1 → man1/view.1
File renamed without changes
View
2  package.json
@@ -27,7 +27,7 @@
{ "mail" : "npm-@googlegroups.com"
, "web" : "http://github.com/isaacs/npm/issues"
}
-, "directories" : { "doc" : "./doc", "man" : "./man", "lib" : "./lib" }
+, "directories" : { "doc" : "./doc", "man" : "./man1", "lib" : "./lib" }
, "bin" : { "npm" : "./cli.js" }
, "main" : "npm"
, "engines" : { "node" : ">=0.2.0" }
Please sign in to comment.
Something went wrong with that request. Please try again.