Created
September 1, 2015 05:49
-
-
Save aespinosa/1fb373c173a5f8717311 to your computer and use it in GitHub Desktop.
Download Bundle from vimrc
This file contains 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 characters
#!/usr/bin/env ruby -ns | |
bundle = $F[2] | |
url, basename = if bundle =~ /^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/ | |
["https://github.com/#{bundle}/archive/master.tar.gz", File.basename(bundle)] | |
elsif bundle =~ /^[A-Za-z0-9._-]+$/ | |
["https://github.com/vim-scripts/#{bundle}/archive/master.tar.gz", bundle] | |
end | |
system "mkdir -p #{basename}" | |
system "curl -L #{url} | gtar -xzv --strip 1 -C #{basename}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment