Skip to content

Instantly share code, notes, and snippets.

@aespinosa
Created September 1, 2015 05:49
Show Gist options
  • Save aespinosa/1fb373c173a5f8717311 to your computer and use it in GitHub Desktop.
Save aespinosa/1fb373c173a5f8717311 to your computer and use it in GitHub Desktop.
Download Bundle from vimrc
#!/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