Commit fb1e4b7a authored by Ed Reel's avatar Ed Reel Committed by Kazushi (Jam) Marukawa

Update nodebrew to add completion support

parent fd9a97b8
......@@ -3,7 +3,7 @@ require 'package'
class Nodebrew < Package
description 'Node.js version manager'
homepage 'https://github.com/hokaccha/nodebrew'
version 'v0.9.7'
version 'v0.9.7-1'
source_url 'https://github.com/hokaccha/nodebrew/archive/v0.9.7.tar.gz'
source_sha256 '3aa8b0cf30024d105f1ac6921aadf0440bc95bcae43df9d6ec58fc9de8cd352e'
......@@ -14,20 +14,27 @@ class Nodebrew < Package
system "NODEBREW_ROOT=#{CREW_DEST_DIR}#{CREW_LIB_PREFIX}/nodebrew perl nodebrew setup > /dev/null"
system "mkdir -p #{CREW_DEST_DIR}#{CREW_PREFIX}/bin"
system "mkdir -p #{CREW_DEST_DIR}/home/#{USER}/user"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew/nodebrew #{CREW_DEST_DIR}#{CREW_PREFIX}/bin/"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew/current/bin/node #{CREW_DEST_DIR}#{CREW_PREFIX}/bin/"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew/current/bin/npm #{CREW_DEST_DIR}#{CREW_PREFIX}/bin/"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew/current/bin/npx #{CREW_DEST_DIR}#{CREW_PREFIX}/bin/"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew $HOME/.nodebrew"
puts ""
puts "Please set PATH environment variable."
puts "\texport PATH=$HOME/.nodebrew/current/bin:$PATH"
puts ""
puts "To install the latest node, please execute:"
puts "\tnodebrew install-binary latest"
puts "\tnodebrew use latest"
puts ""
system "ln -s #{CREW_LIB_PREFIX}/nodebrew #{CREW_DEST_DIR}/home/#{USER}/user/.nodebrew"
system "ln -s #{CREW_LIB_PREFIX}/nodebrew /home/#{USER}/user/.nodebrew"
puts
puts "Nodebrew completion support is available for the following shells:"
puts "bash fish zsh"
puts
puts "To add nodebrew completion for bash, execute the following:".lightblue
puts "echo '# nodebrew completion' >> ~/.bashrc".lightblue
puts "echo 'if [ -f #{CREW_LIB_PREFIX}/nodebrew/completions/bash/nodebrew-completion ]; then' >> ~/.bashrc".lightblue
puts "echo ' source #{CREW_LIB_PREFIX}/nodebrew/completions/bash/nodebrew-completion' >> ~/.bashrc".lightblue
puts "echo 'fi' >> ~/.bashrc".lightblue
puts "source ~/.bashrc".lightblue
puts
puts "To install the latest node, please execute:".lightblue
puts "\tnodebrew install-binary latest".lightblue
puts "\tnodebrew use latest".lightblue
puts
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment