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
c3467317
Commit
c3467317
authored
Sep 03, 2015
by
Bruno Pinto
Committed by
Pablo Santiago Blum de Aguiar
Oct 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify install command
- Install does not do update. - Share code when installing from URL or name.
parent
2f3a8cdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
41 deletions
+34
-41
pkg/omf/cli/omf.install.fish
pkg/omf/cli/omf.install.fish
+29
-36
pkg/omf/cli/omf.install_package.fish
pkg/omf/cli/omf.install_package.fish
+1
-1
pkg/omf/omf.fish
pkg/omf/omf.fish
+4
-4
No files found.
pkg/omf/cli/omf.install.fish
View file @
c3467317
function omf.install -a
type_flag
name_or_url
function _
display_
success
function omf.install -a name_or_url
function _
_omf.install.
success
echo (omf::em)"✔ $argv successfully installed."(omf::off)
end
function _
display_
error
function _
_omf.install.
error
echo (omf::err)"Could not install $argv."(omf::off) 1^&2
end
switch $type_flag
case "--theme"
set install_type "theme"
set parent_path "themes"
case "--pkg"
set install_type "package"
set parent_path "pkg"
case "*"
echo (omf::err)"Argument to omf.install must be --theme [name|URL] or --pkg [name|URL]"(omf::off)
return $OMF_INVALID_ARG
if test \( -e $OMF_PATH/db/themes/$name_or_url \) -o (echo $name_or_url | grep theme-)
set install_type "theme"
set parent_path "themes"
else
set install_type "package"
set parent_path "pkg"
end
if test -e $OMF_PATH/db/$parent_path/$name_or_url
set target $parent_path/$name_or_url
set name $name_or_url
set url (cat $OMF_PATH/db/$parent_path/$name_or_url)
else
set -l local_name (basename $name_or_url | sed "s/^pkg-//;s/^plugin-//;s/^theme-//")
if test -e $OMF_PATH/$parent_path/$local_name
echo (omf::err)"Error: $local_name $install_type already installed."(omf::off) 1^&2
else
echo (omf::dim)"Trying to clone from URL..."(omf::off)
if omf.repo.clone $name_or_url $OMF_PATH/$parent_path/$local_name
omf.bundle.add $install_type $name_or_url
_display_success "$install_type $name_or_url"
else
_display_error "$install_type $name_or_url"
return $OMF_UNKNOWN_ERR
end
end
return 0
set name (basename $name_or_url | sed "s/^pkg-//;s/^plugin-//;s/^theme-//")
set url $name_or_url
end
if test -e $OMF_PATH/$target
echo (omf::dim)"Updating $name_or_url $install_type..."(omf::off)
omf.repo.pull $OMF_PATH/$target
echo (omf::em)"✔ $name_or_url $install_type up to date."(omf::off)
if test -e $OMF_PATH/$parent_path/$name
if test "$install_type" = theme
omf.theme $name
else
echo (omf::err)"Error: $name $install_type already installed."(omf::off) 1^&2
return $OMF_INVALID_ARG
end
else
echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off)
if omf.repo.clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target
echo (omf::dim)"Installing $install_type $name"(omf::off)
if omf.repo.clone $url $OMF_PATH/$parent_path/$name
omf.bundle.add $install_type $name_or_url
_display_success "$install_type $name_or_url"
__omf.install.success "$install_type $name"
if test "$install_type" = theme
omf.theme $name
end
else
_
display_error "$install_type $name_or_url
"
_
_omf.install.error "$install_type $name
"
return $OMF_UNKNOWN_ERR
end
end
...
...
pkg/omf/cli/omf.install_package.fish
View file @
c3467317
function omf.install_package
for search in $argv
omf.install
--pkg
$search
omf.install $search
end
end
pkg/omf/omf.fish
View file @
c3467317
...
...
@@ -78,7 +78,10 @@ function omf -d "Oh My Fish"
if test (count $argv) -eq 1
omf.bundle.install
else
omf.install_package $argv[2..-1]
for package in $argv[2..-1]
omf.install $package
end
refresh
end
...
...
@@ -121,9 +124,6 @@ function omf -d "Oh My Fish"
omf.packages.list --database --theme | column | sed -E "s/$regex/"(omf::em)"\1"(omf::off)"/"
omf::off
else if test (count $argv) -eq 2
if not contains -- $argv[2] (omf.packages.list --installed)
omf.install --theme $argv[2]; or return 1
end
omf.theme $argv[2]
else
echo (omf::err)"Invalid number of arguments"(omf::off) 1^&2
...
...
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