simplify installation
This commit is contained in:
parent
749a28145e
commit
fef534c1d0
61
Rakefile
61
Rakefile
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle')
|
|
||||||
|
|
||||||
def macos?
|
def macos?
|
||||||
RUBY_PLATFORM.downcase.include?('darwin')
|
RUBY_PLATFORM.downcase.include?('darwin')
|
||||||
@ -47,11 +46,6 @@ task install: %i[submodule_init submodules] do
|
|||||||
install_rvm_binstubs
|
install_rvm_binstubs
|
||||||
|
|
||||||
Rake::Task['link_files'].execute
|
Rake::Task['link_files'].execute
|
||||||
if want_to_install?('vim configuration (highly recommended)')
|
|
||||||
install_files(Dir.glob('{vim}'))
|
|
||||||
Rake::Task['install_vundle'].execute
|
|
||||||
end
|
|
||||||
|
|
||||||
Rake::Task['install_tools'].execute
|
Rake::Task['install_tools'].execute
|
||||||
Rake::Task['install_prezto'].execute
|
Rake::Task['install_prezto'].execute
|
||||||
|
|
||||||
@ -70,11 +64,8 @@ end
|
|||||||
|
|
||||||
desc 'install spacevim and related config files'
|
desc 'install spacevim and related config files'
|
||||||
task :install_spacevim do
|
task :install_spacevim do
|
||||||
run %(
|
run 'curl -sLf https://spacevim.org/install.sh | bash'
|
||||||
curl -sLf https://spacevim.org/install.sh | bash
|
install_files(Dir.glob('SpaceVim*'))
|
||||||
rm -rf ~/.SpaceVim.d
|
|
||||||
ln -s $(pwd)/SpaceVim.d ~/.SpaceVim.d
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Install tools which are necessary for developers'
|
desc 'Install tools which are necessary for developers'
|
||||||
@ -128,49 +119,6 @@ task :submodules do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Performs migration from pathogen to vundle'
|
|
||||||
task :vundle_migration do
|
|
||||||
puts '======================================================'
|
|
||||||
puts 'Migrating from pathogen to vundle vim plugin manager. '
|
|
||||||
puts 'This will move the old .vim/bundle directory to'
|
|
||||||
puts '.vim/bundle.old and replacing all your vim plugins with'
|
|
||||||
puts 'the standard set of plugins. You will then be able to '
|
|
||||||
puts "manage your vim's plugin configuration by editing the "
|
|
||||||
puts 'file .vim/vundles.vim'
|
|
||||||
puts '======================================================'
|
|
||||||
|
|
||||||
Dir.glob(File.join('vim', 'bundle', '**')) do |sub_path|
|
|
||||||
run %(git config -f #{File.join('.git', 'config')} --remove-section submodule.#{sub_path})
|
|
||||||
# `git rm --cached #{sub_path}`
|
|
||||||
FileUtils.rm_rf(File.join('.git', 'modules', sub_path))
|
|
||||||
end
|
|
||||||
FileUtils.mv(File.join('vim', 'bundle'), File.join('vim', 'bundle.old'))
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Runs Vundle installer in a clean vim environment'
|
|
||||||
task :install_vundle do
|
|
||||||
puts '======================================================'
|
|
||||||
puts 'Installing and updating vundles.'
|
|
||||||
puts 'The installer will now proceed to run PluginInstall to install vundles.'
|
|
||||||
puts '======================================================'
|
|
||||||
|
|
||||||
puts ''
|
|
||||||
|
|
||||||
vundle_path = File.join('vim', 'bundle', 'vundle')
|
|
||||||
unless File.exist?(vundle_path)
|
|
||||||
run %(
|
|
||||||
cd $HOME/.yadr
|
|
||||||
git clone https://github.com/gmarik/vundle.git #{vundle_path}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
Vundle.update_vundle
|
|
||||||
end
|
|
||||||
|
|
||||||
task :plugin_sync do
|
|
||||||
Vundle.plugin_sync
|
|
||||||
end
|
|
||||||
|
|
||||||
task default: 'install'
|
task default: 'install'
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -406,11 +354,6 @@ def needs_migration_to_vundle?
|
|||||||
File.exist? File.join('vim', 'bundle', 'tpope-vim-pathogen')
|
File.exist? File.join('vim', 'bundle', 'tpope-vim-pathogen')
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_vim_submodules
|
|
||||||
result = `git submodule -q foreach 'echo $name"||"\`git remote -v | awk "END{print \\\\\$2}"\`'`.select { |line| line =~ /^vim.bundle/ }.map { |line| line.split('||') }
|
|
||||||
Hash[*result.flatten]
|
|
||||||
end
|
|
||||||
|
|
||||||
def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
|
def apply_theme_to_iterm_profile_idx(index, color_scheme_path)
|
||||||
values = []
|
values = []
|
||||||
16.times { |i| values << "Ansi #{i} Color" }
|
16.times { |i| values << "Ansi #{i} Color" }
|
||||||
|
Loading…
Reference in New Issue
Block a user