Skip to content

Instantly share code, notes, and snippets.

@lennart
Created June 6, 2011 18:48
Show Gist options
  • Save lennart/1010816 to your computer and use it in GitHub Desktop.
Save lennart/1010816 to your computer and use it in GitHub Desktop.
Add -L to curl for following locations (small workaround for github.com/…/raw/… => raw.github.com)
diff --git a/Rakefile b/Rakefile
index d72fe2c..4752efd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -19,16 +19,16 @@ def vim_plugin_task(name, repo=nil)
sh "git clone #{repo} #{dir}"
elsif repo =~ /download_script/
- if filename = `curl --silent --head #{repo} | grep attachment`[/filename=(.+)/,1]
+ if filename = `curl -L --silent --head #{repo} | grep attachment`[/filename=(.+)/,1]
filename.strip!
- sh "curl #{repo} > tmp/#{filename}"
+ sh "curl -L #{repo} > tmp/#{filename}"
else
raise ArgumentError, 'unable to determine script type'
end
elsif repo =~ /(tar|gz|vba|zip)$/
filename = File.basename(repo)
- sh "curl #{repo} > tmp/#{filename}"
+ sh "curl -L #{repo} > tmp/#{filename}"
else
raise ArgumentError, 'unrecognized source url for plugin'
@@ -204,10 +204,10 @@ vim_plugin_task "janus_themes" do
end
vim_plugin_task "molokai" do
- sh "curl https://github.com/mrtazz/molokai.vim/raw/master/colors/molokai.vim > colors/molokai.vim"
+ sh "curl -L https://github.com/mrtazz/molokai.vim/raw/master/colors/molokai.vim > colors/molokai.vim"
end
vim_plugin_task "mustache" do
- sh "curl https://github.com/defunkt/mustache/raw/master/contrib/mustache.vim > syntax/mustache.vim"
+ sh "curl -L https://github.com/defunkt/mustache/raw/master/contrib/mustache.vim > syntax/mustache.vim"
File.open(File.expand_path('../ftdetect/mustache.vim', __FILE__), 'w') do |file|
file << "au BufNewFile,BufRead *.mustache setf mustache"
end
@@ -218,7 +218,7 @@ vim_plugin_task "arduino","git://github.com/vim-scripts/Arduino-syntax-file.git"
end
end
vim_plugin_task "vwilight" do
- sh "curl https://gist.github.com/raw/796172/724c7ca237a7f6b8d857c4ac2991cfe5ffb18087/vwilight.vim > colors/vwilight.vim"
+ sh "curl -L https://gist.github.com/raw/796172/724c7ca237a7f6b8d857c4ac2991cfe5ffb18087/vwilight.vim > colors/vwilight.vim"
end
if File.exists?(janus = File.expand_path("~/.janus.rake"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment