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
c929fa41
Commit
c929fa41
authored
Sep 07, 2015
by
Derek Stavis
Committed by
Derek Stavis
Sep 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bundle: move related functions to omf.bundle namespace
parent
d5293689
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
34 deletions
+35
-34
pkg/omf/cli/omf.bundle.add.fish
pkg/omf/cli/omf.bundle.add.fish
+1
-1
pkg/omf/cli/omf.bundle.install.fish
pkg/omf/cli/omf.bundle.install.fish
+6
-5
pkg/omf/cli/omf.bundle.remove.fish
pkg/omf/cli/omf.bundle.remove.fish
+23
-0
pkg/omf/cli/omf.install.fish
pkg/omf/cli/omf.install.fish
+2
-2
pkg/omf/cli/omf.remove_package.fish
pkg/omf/cli/omf.remove_package.fish
+2
-25
pkg/omf/omf.fish
pkg/omf/omf.fish
+1
-1
No files found.
pkg/omf/cli/omf.
persist
.fish
→
pkg/omf/cli/omf.
bundle.add
.fish
View file @
c929fa41
function omf.
persist
-a type name_or_url
function omf.
bundle.add
-a type name_or_url
function __omf.write_bundle
function __omf.write_bundle
set -l bundle $OMF_CONFIG/bundle
set -l bundle $OMF_CONFIG/bundle
set -l record $argv
set -l record $argv
...
...
pkg/omf/cli/omf.
install_bundle
.fish
→
pkg/omf/cli/omf.
bundle.install
.fish
View file @
c929fa41
function omf.
install_bundle
function omf.
bundle.install
if test -f $OMF_CONFIG/bundle
if test -f $OMF_CONFIG/bundle
set packages (omf.list_local_packages)
set packages (omf.list_local_packages)
set themes (omf.list_installed_themes)
set themes (omf.list_installed_themes)
for record in (cat $OMF_CONFIG/bundle)
for record in (cat $OMF_CONFIG/bundle
| uniq
)
set type (echo $record | cut -d' ' -f1)
set type (echo $record | cut -d' ' -f1)
set name (echo $record | cut -d' ' -f2- | sed -e 's/\.git//')
set name_or_url (echo $record | cut -d' ' -f2-)
set name (basename $name_or_url | sed 's/\.git//;s/^pkg-//;s/^plugin-//;s/^theme-//')
switch $type
switch $type
case "package"
case "package"
if not contains
(basename $name)
$packages
if not contains
$name
$packages
omf.install --pkg $name
omf.install --pkg $name
end
end
case "theme"
case "theme"
if not contains
(basename $name)
$themes
if not contains
$name
$themes
omf.install --theme $name
omf.install --theme $name
end
end
end
end
...
...
pkg/omf/cli/omf.bundle.remove.fish
0 → 100644
View file @
c929fa41
function omf.bundle.remove
set bundle $OMF_CONFIG/bundle
if test -f $bundle
set type $argv[1]
set name $argv[2]
set bundle_contents (cat $bundle | uniq)
rm -f $bundle
for record in $bundle_contents
set record_type (echo $record | cut -d' ' -f1)
set record_name (echo $record | cut -d' ' -f2-)
set record_basename (basename (echo $record_name | \
sed -e 's/\.git$//') | sed 's/^pkg-//;s/^plugin-//;s/^theme-//')
if not test "$type" = "$record_type" -a "$name" = "$record_basename"
echo "$record_type $record_name" >> $bundle
end
end
end
end
pkg/omf/cli/omf.install.fish
View file @
c929fa41
...
@@ -29,7 +29,7 @@ function omf.install -a type_flag name_or_url
...
@@ -29,7 +29,7 @@ function omf.install -a type_flag name_or_url
else
else
echo (omf::dim)"Trying to clone from URL..."(omf::off)
echo (omf::dim)"Trying to clone from URL..."(omf::off)
if omf.repo.clone $name_or_url $OMF_PATH/$parent_path/$local_name
if omf.repo.clone $name_or_url $OMF_PATH/$parent_path/$local_name
omf.
persist
$install_type $name_or_url
omf.
bundle.add
$install_type $name_or_url
_display_success "$install_type $name_or_url"
_display_success "$install_type $name_or_url"
else
else
_display_error "$install_type $name_or_url"
_display_error "$install_type $name_or_url"
...
@@ -47,7 +47,7 @@ function omf.install -a type_flag name_or_url
...
@@ -47,7 +47,7 @@ function omf.install -a type_flag name_or_url
else
else
echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off)
echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off)
if omf.repo.clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target
if omf.repo.clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target
omf.
persist
$install_type $name_or_url
omf.
bundle.add
$install_type $name_or_url
_display_success "$install_type $name_or_url"
_display_success "$install_type $name_or_url"
else
else
_display_error "$install_type $name_or_url"
_display_error "$install_type $name_or_url"
...
...
pkg/omf/cli/omf.remove_package.fish
View file @
c929fa41
function omf.remove_package
function omf.remove_package
function _remove_from_bundle
set bundle $OMF_CONFIG/bundle
if test -f $bundle
set type $argv[1]
set name $argv[2]
set bundle_contents (cat $bundle)
rm -f $bundle
for record in $bundle_contents
set record_type (echo $record | cut -d' ' -f1)
set record_name (echo $record | cut -d' ' -f2-)
set record_basename (basename (echo $record_name | sed -e 's/\.git$//'))
if not test "$type" = "$record_type" -a "$name" = "$record_basename"
echo "$record_type $record_name" >> $bundle
end
end
end
end
for pkg in $argv
for pkg in $argv
set -l remove_status 1
set -l remove_status 1
...
@@ -39,7 +16,7 @@ function omf.remove_package
...
@@ -39,7 +16,7 @@ function omf.remove_package
not test -d $path; and continue
not test -d $path; and continue
emit uninstall_$pkg
emit uninstall_$pkg
_remove_from_bundl
e "package" $pkg
omf.bundle.remov
e "package" $pkg
rm -rf $path
rm -rf $path
set remove_status $status
set remove_status $status
...
@@ -52,7 +29,7 @@ function omf.remove_package
...
@@ -52,7 +29,7 @@ function omf.remove_package
echo default > $OMF_CONFIG/theme
echo default > $OMF_CONFIG/theme
end
end
_remove_from_bundl
e "theme" $pkg
omf.bundle.remov
e "theme" $pkg
rm -rf $path
rm -rf $path
set remove_status $status
set remove_status $status
...
...
pkg/omf/omf.fish
View file @
c929fa41
...
@@ -89,7 +89,7 @@ function omf -d "Oh My Fish"
...
@@ -89,7 +89,7 @@ function omf -d "Oh My Fish"
case "i" "install" "get"
case "i" "install" "get"
if test (count $argv) -eq 1
if test (count $argv) -eq 1
omf.
install_bundle
omf.
bundle.install
else
else
omf.install_package $argv[2..-1]
omf.install_package $argv[2..-1]
refresh
refresh
...
...
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