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
5ed67522
Commit
5ed67522
authored
Nov 03, 2013
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extracting _append_path function
parent
985c2387
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
functions/_append_path.fish
functions/_append_path.fish
+13
-0
oh-my-fish.fish
oh-my-fish.fish
+6
-21
No files found.
functions/_append_path.fish
0 → 100644
View file @
5ed67522
# Appends the path to the specified path list. If no list specified,
# defaults to $PATH
function _append_path
set -l path PATH
if test (echo $argv | wc -w) -eq 2
set path $argv[2]
end
if test -d $argv[1]; and not contains $argv[1] $$path
set $path $argv[1] $$path
end
end
oh-my-fish.fish
View file @
5ed67522
...
...
@@ -13,26 +13,16 @@ function _fish_add_plugin
set -l plugin $argv[1]
set -l plugin_path "plugins/$plugin"
if _test_dir $fish_path/$plugin_path $fish_function_path
set fish_function_path $fish_path/$plugin_path $fish_function_path
end
if _test_dir $fish_custom/$plugin_path $fish_function_path
set fish_function_path $fish_custom/$plugin_path $fish_function_path
end
_append_path $fish_path/$plugin_path fish_function_path
_append_path $fish_custom/$plugin_path fish_function_path
end
function _fish_add_completion
set -l plugin $argv[1]
set -l completion_path "plugins/$plugin/completions"
if test -d $fish_path/$completion_path
set fish_complete_path $fish_path/$completion_path $fish_complete_path
end
if test -d $fish_custom/$completion_path
set fish_complete_path $fish_custom/$completion_path $fish_complete_path
end
_append_path $fish_path/$completion_path fish_complete_path
_append_path $fish_custom/$completion_path fish_complete_path
end
function _fish_source_plugin_load_file
...
...
@@ -49,13 +39,8 @@ function _fish_source_plugin_load_file
end
function _fish_load_theme
if _test_dir $fish_path/themes/$fish_theme $fish_function_path
set fish_function_path $fish_path/themes/$fish_theme $fish_function_path
end
if _test_dir $fish_custom/themes/$fish_theme $fish_function_path
set fish_function_path $fish_custom/themes/$fish_theme $fish_function_path
end
_append_path $fish_path/themes/$fish_theme fish_function_path
_append_path $fish_custom/themes/$fish_theme fish_function_path
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