Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
21848fdf
Commit
21848fdf
authored
May 26, 2015
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fish install and updated functions
parent
e2d9ad8f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
0 deletions
+158
-0
functions/Plugin.fish
functions/Plugin.fish
+2
-0
functions/Theme.fish
functions/Theme.fish
+2
-0
functions/fish.fish
functions/fish.fish
+20
-0
functions/fish.log.fish
functions/fish.log.fish
+17
-0
functions/fish.packages.fish
functions/fish.packages.fish
+28
-0
functions/fish.packages.install.fish
functions/fish.packages.install.fish
+36
-0
functions/fish.packages.update.fish
functions/fish.packages.update.fish
+53
-0
No files found.
functions/Plugin.fish
View file @
21848fdf
function Plugin --argument-names name
function Plugin --argument-names name
set -g fish_plugins $fish_plugins $name
if [ -e $fish_path/plugins/$name -o -e $fish_custom/plugins/$name ]
if [ -e $fish_path/plugins/$name -o -e $fish_custom/plugins/$name ]
import plugins/$name
import plugins/$name
else
else
...
...
functions/Theme.fish
View file @
21848fdf
function Theme --argument-names name
function Theme --argument-names name
set -g fish_theme $name
if [ -e $fish_path/themes/$name -o -e $fish_custom/themes/$name ]
if [ -e $fish_path/themes/$name -o -e $fish_custom/themes/$name ]
import themes/$name
import themes/$name
else
else
...
...
functions/fish.fish
0 → 100644
View file @
21848fdf
# NAME
# fish - Extend default fish binary
#
# DESCRIPTION
# Extend fish binary to support plugins and themes installation
#
function fish -d "Extend fish binary"
if test (count $argv) -gt 0
switch $argv[1]
case 'install'
fish.packages --install
case 'update'
fish.packages --update
case '*'
command fish $argv
end
else
command fish
end
end
functions/fish.log.fish
0 → 100644
View file @
21848fdf
# NAME
# fish.log - simple log with color
#
# SYNOPSIS
# <string> [<string>...]
#
# DESCRIPTION
# Simply log a message with a specified color.
#
function fish.log -d "Simple log with color"
switch $argv[1]
case '-*'
echo $argv[1] (set_color $argv[2])$argv[3..-1](set_color normal)
case '*'
echo -e (set_color $argv[1])$argv[2..-1](set_color normal)
end
end
functions/fish.packages.fish
0 → 100644
View file @
21848fdf
# NAME
# fish.packages - Manage all plugins and themes
#
# SYNOPSIS
# fish.packages [OPTIONS]
#
# OPTIONS
# --install
# Install all packages
# --update
# Update all packages
#
# DESCRIPTION
# Manage all plugins and themes specified on the $fish_plugins
# and $fish_theme variables
#
function fish.packages --argument-names options -d 'Manage all plugins and themes'
set -l modified_packages 0
switch $options
case "--install"
fish.packages.install
case "--update"
fish.packages.update
case "*"
fish.log red 'Unknown option'
end
end
functions/fish.packages.install.fish
0 → 100644
View file @
21848fdf
# NAME
# fish.packages.install - Install all plugins and themes
#
# DESCRIPTION
# Install all plugins and themes specified on the $fish_plugins
# and $fish_theme variables
#
function fish.packages.install -d "Install all plugins and themes"
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
fish.log -n white "Installing $plugin... "
git clone "https://github.com/oh-my-fish/plugins-$plugin" $fish_path/plugins/$plugin ^ /dev/null
fish.log green "√"
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
fish.log -n white "Installing $fish_theme... "
git clone "https://github.com/oh-my-fish/themes-$fish_theme" $fish_path/themes/$fish_theme ^ /dev/null
fish.log green "√"
set -l installed_packages 1
end
if [ $installed_packages -eq 0 ]
fish.log green 'All plugins were already installed.'
end
end
functions/fish.packages.update.fish
0 → 100644
View file @
21848fdf
# NAME
# fish.packages.update - Update all plugins and themes
#
# DESCRIPTION
# Update all plugins and themes specified on the $fish_plugins
# and $fish_theme variables
#
function fish.packages.update -d "Update all plugins and themes"
set -l installed_packages 0
pushd
# Plugins
for plugin in $fish_plugins
if [ -e $fish_path/plugins/$plugin -a -e $fish_path/plugins/$plugin/.git ]
fish.log -n white "Updating $plugin... "
echo (cd $fish_path/plugins/$plugin; and git pull --rebase > /dev/null) >/dev/null
fish.log green "√"
set -l installed_packages 1
else
if [ -e $fish_custom/plugins/$plugin -a -e $fish_custom/plugins/$plugin/.git ]
fish.log -n white "Updating $plugin... "
echo (cd $fish_custom/plugins/$plugin; and git pull --rebase > /dev/null) >/dev/null
fish.log green "√"
set -l installed_packages 1
else
#echo "$plugin is not installed or not a git repo. Skipping."
end
end
end
# Theme
if [ -e $fish_path/themes/$fish_theme -a -e $fish_path/themes/$fish_theme/.git ]
fish.log -n white "Updating $fish_theme... "
echo (cd $fish_path/themes/$fish_theme; and git pull --rebase > /dev/null) >/dev/null
fish.log green "√"
set -l installed_packages 1
else
if [ -e $fish_custom/themes/$fish_theme -a -e $fish_custom/themes/$fish_theme/.git ]
fish.log -n white "Updating $fish_theme... "
echo (cd $fish_custom/themes/$fish_theme; and git pull --rebase > /dev/null) >/dev/null
fish.log green "√"
set -l installed_packages 1
else
#echo "$fish_theme is not installed or not a git repo. Skipping."
end
end
if [ $installed_packages -eq 0 ]
fish.log green 'No plugins to update.'
end
popd
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment