Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # npm-edit
- #
- # == Usage
- #
- # npm-edit express
- #
- unless package = ARGV[0]
- puts "Usage: #{File.basename($0)} PACKAGE_NAME"
- exit!
- end
- dir = `npm config list`.
- split(/\n/).
- select {|i| i =~ /^root/}.
- first.
- split(/\s+/)[2].
- gsub('"', '')
- system ENV['EDITOR'], File.join(dir, ".npm", package, "active", "package")
Add Comment
Please, Sign In to add comment