Merge pull request #851 from nandalopes/prezto-install
prezto_install rake task
This commit is contained in:
23
Rakefile
23
Rakefile
@@ -262,11 +262,12 @@ def install_prezto
|
|||||||
run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" }
|
run %{ ln -nfs "$HOME/.yadr/zsh/prezto" "${ZDOTDIR:-$HOME}/.zprezto" }
|
||||||
|
|
||||||
# The prezto runcoms are only going to be installed if zprezto has never been installed
|
# The prezto runcoms are only going to be installed if zprezto has never been installed
|
||||||
install_files(Dir.glob('zsh/prezto/runcoms/z*'), :symlink)
|
install_files(Dir.glob('zsh/prezto-override/zshrc'), :symlink)
|
||||||
|
install_files(Dir.glob('zsh/prezto/runcoms/zlogin'), :symlink)
|
||||||
puts
|
install_files(Dir.glob('zsh/prezto/runcoms/zlogout'), :symlink)
|
||||||
puts "Overriding prezto ~/.zpreztorc with YADR's zpreztorc to enable additional modules..."
|
install_files(Dir.glob('zsh/prezto-override/zpreztorc'), :symlink)
|
||||||
run %{ ln -nfs "$HOME/.yadr/zsh/prezto-override/zpreztorc" "${ZDOTDIR:-$HOME}/.zpreztorc" }
|
install_files(Dir.glob('zsh/prezto/runcoms/zprofile'), :symlink)
|
||||||
|
install_files(Dir.glob('zsh/prezto/runcoms/zshenv'), :symlink)
|
||||||
|
|
||||||
puts
|
puts
|
||||||
puts "Creating directories for your customizations"
|
puts "Creating directories for your customizations"
|
||||||
@@ -320,18 +321,6 @@ def install_files(files, method = :symlink)
|
|||||||
run %{ cp -f "#{source}" "#{target}" }
|
run %{ cp -f "#{source}" "#{target}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Temporary solution until we find a way to allow customization
|
|
||||||
# This modifies zshrc to load all of yadr's zsh extensions.
|
|
||||||
# Eventually yadr's zsh extensions should be ported to prezto modules.
|
|
||||||
source_config_code = "for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file"
|
|
||||||
if file == 'zshrc'
|
|
||||||
File.open(target, 'a+') do |zshrc|
|
|
||||||
if zshrc.readlines.grep(/#{Regexp.escape(source_config_code)}/).empty?
|
|
||||||
zshrc.puts(source_config_code)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
puts "=========================================================="
|
puts "=========================================================="
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|||||||
3
zsh/prezto-override/zshrc
Normal file
3
zsh/prezto-override/zshrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source $HOME/.zprezto/runcoms/zshrc
|
||||||
|
|
||||||
|
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
|
||||||
Reference in New Issue
Block a user