oh-my-fish/plugins/omf/omf.packages.install.fish

37 lines
1.1 KiB
Fish
Raw Normal View History

2015-05-26 21:48:21 +08:00
# NAME
2015-05-31 19:31:55 +08:00
# omf.packages.install - Install all plugins and themes
2015-05-26 21:48:21 +08:00
#
# DESCRIPTION
# Install all plugins and themes specified on the $fish_plugins
# and $fish_theme variables
#
2015-05-31 19:31:55 +08:00
function omf.packages.install -d "Install all plugins and themes"
2015-05-26 21:48:21 +08:00
set -l installed_packages 0
# Plugins
for plugin in $fish_plugins
if [ -e $fish_path/plugins/$plugin -o -e $fish_custom/plugins/$plugin ]
#echo "$plugin is already installed. Skipping."
else
2015-05-31 19:31:55 +08:00
omf.log -n white "Installing $plugin... "
2015-05-26 21:48:21 +08:00
git clone "https://github.com/oh-my-fish/plugins-$plugin" $fish_path/plugins/$plugin ^ /dev/null
2015-05-31 19:31:55 +08:00
omf.log green "√"
2015-05-26 21:48:21 +08:00
set -l installed_packages 1
end
end
# Theme
if [ -e $fish_path/themes/$fish_theme -o -e $fish_custom/themes/$fish_theme ]
#echo "$fish_theme is already installed. Skipping."
else
2015-05-31 19:31:55 +08:00
omf.log -n white "Installing $fish_theme... "
2015-05-26 21:48:21 +08:00
git clone "https://github.com/oh-my-fish/themes-$fish_theme" $fish_path/themes/$fish_theme ^ /dev/null
2015-05-31 19:31:55 +08:00
omf.log green "√"
2015-05-26 21:48:21 +08:00
set -l installed_packages 1
end
if [ $installed_packages -eq 0 ]
2015-05-31 19:31:55 +08:00
omf.log green 'All plugins were already installed.'
2015-05-26 21:48:21 +08:00
end
end