From fef534c1d00972111e85c0b17444a5b88f7fe60c Mon Sep 17 00:00:00 2001 From: hophacker Date: Mon, 10 Feb 2020 14:06:45 +0800 Subject: [PATCH] simplify installation --- .yadr | 0 Rakefile | 61 ++------------------------------------------------------ 2 files changed, 2 insertions(+), 59 deletions(-) delete mode 100644 .yadr diff --git a/.yadr b/.yadr deleted file mode 100644 index e69de29..0000000 diff --git a/Rakefile b/Rakefile index 06eb01a..ec919fc 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,6 @@ require 'rake' require 'fileutils' -require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle') def macos? RUBY_PLATFORM.downcase.include?('darwin') @@ -47,11 +46,6 @@ task install: %i[submodule_init submodules] do install_rvm_binstubs 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_prezto'].execute @@ -70,11 +64,8 @@ end desc 'install spacevim and related config files' task :install_spacevim do - run %( - curl -sLf https://spacevim.org/install.sh | bash - rm -rf ~/.SpaceVim.d - ln -s $(pwd)/SpaceVim.d ~/.SpaceVim.d - ) + run 'curl -sLf https://spacevim.org/install.sh | bash' + install_files(Dir.glob('SpaceVim*')) end desc 'Install tools which are necessary for developers' @@ -128,49 +119,6 @@ task :submodules do 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' private @@ -406,11 +354,6 @@ def needs_migration_to_vundle? File.exist? File.join('vim', 'bundle', 'tpope-vim-pathogen') 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) values = [] 16.times { |i| values << "Ansi #{i} Color" }