Revisions
-
burke revised this gist
Mar 18, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ Boxen uses a bunch of shellscripts to insert itself into your environment on shell load. These assume a POSIX shell, which fish is not. Run this script to generate a fish-compatible config file in `~/.config/fish/boxen.fish`, which you can source at the end of your `~/.config/fish/config.fish`. -
burke revised this gist
Mar 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Dir.chdir("/opt/boxen") do File.open(File.expand_path("~/.config/fish/boxen.fish"), "w") do |f| ["env.sh", *Dir.glob("env.d/*.sh")].each do |file| -
burke created this gist
Mar 1, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #!/usr/bin/env ruby Dir.chdir("/opt/boxen") do File.open("env.fish", "w") do |f| ["env.sh", *Dir.glob("env.d/*.sh")].each do |file| File.readlines(file).each do |line| case line when /^#!/ f.puts "#!/usr/bin/env fish" when /^\s*(?:export )?(.*?)=(.*)/ name, content = $1, $2 content.gsub!(/:\$/, ' $') # yay fuzzy heuristics content.gsub!(/`(.*)`/) { contents = $1 contents.sub!(/^([^\s]+?)=([^\s]+)/, 'env \1=\2') "(#{contents})" } content.gsub!(/\$\{(.*)\}/, '(\1)') f.print "set -x #{name} #{content}\n" when /^\s*set [\-\+][eu]/ f.print "# #{line.chomp}\n" when /^\s*#.*/ f.print line when /^\s*$/ f.print line else f.print "###### PARSE ERR: #{line.chomp}\n" end end end f.puts "set -x PATH /opt/boxen/rbenv/shims /opt/boxen/rbenv/bin $PATH" f.puts "rbenv rehash 2>/dev/null" f.puts "function git ; hub $argv ; end" end end