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
ef4d4aff
Commit
ef4d4aff
authored
Sep 06, 2015
by
Bruno
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15 from oh-my-fish/omf-persist
Extract _write_bundle to omf.persist
parents
75594ea4
033d976d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
pkg/omf/cli/omf.install.fish
pkg/omf/cli/omf.install.fish
+2
-15
pkg/omf/cli/omf.persist.fish
pkg/omf/cli/omf.persist.fish
+23
-0
No files found.
pkg/omf/cli/omf.install.fish
View file @
ef4d4aff
function omf.install -a type_flag name_or_url
function _write_bundle
set bundle $OMF_CONFIG/bundle
set record $argv
if test -f $bundle
if not grep $record $bundle > /dev/null 2>&1
echo $record >> $bundle
end
else
echo $record > $bundle
end
end
function _display_success
echo (omf::em)"✔ $argv successfully installed."(omf::off)
end
...
...
@@ -42,7 +29,7 @@ function omf.install -a type_flag name_or_url
else
echo (omf::dim)"Trying to clone from URL..."(omf::off)
if git clone -q $name_or_url $OMF_PATH/$parent_path/$local_name
_write_bundle "$install_type $name_or_url"
omf.persist $install_type $name_or_url
_display_success "$install_type $name_or_url"
else
_display_error "$install_type $name_or_url"
...
...
@@ -60,7 +47,7 @@ function omf.install -a type_flag name_or_url
else
echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off)
if git clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target >/dev/null ^&1
_write_bundle "$install_type $name_or_url"
omf.persist $install_type $name_or_url
_display_success "$install_type $name_or_url"
else
_display_error "$install_type $name_or_url"
...
...
pkg/omf/cli/omf.persist.fish
0 → 100644
View file @
ef4d4aff
function omf.persist -a type name_or_url
function __omf.write_bundle
set -l bundle $OMF_CONFIG/bundle
set -l record $argv
if test -f $bundle
if not grep $record $bundle > /dev/null 2>&1
echo $record >> $bundle
end
else
echo $record > $bundle
end
end
function __omf.write_theme
echo $argv > $OMF_CONFIG/theme
end
__omf.write_bundle "$type" "$name_or_url"
if test "$type" = theme
__omf.write_theme "$name_or_url"
end
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