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
c6e72863
Commit
c6e72863
authored
Aug 27, 2015
by
Wes Morgan
Committed by
Jorge Bucaran
Aug 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
centralize pkg / theme installation
parent
f7677581
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
41 deletions
+49
-41
pkg/omf/cli/omf.install.fish
pkg/omf/cli/omf.install.fish
+47
-0
pkg/omf/cli/omf.install_package.fish
pkg/omf/cli/omf.install_package.fish
+1
-29
pkg/omf/cli/omf.theme.fish
pkg/omf/cli/omf.theme.fish
+1
-12
No files found.
pkg/omf/cli/omf.install.fish
0 → 100644
View file @
c6e72863
function omf.install -a type_flag name_or_url
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
end
if test -e $OMF_PATH/db/$parent_path/$name_or_url
set target $parent_path/$name_or_url
else
set -l local_name (basename $name_or_url)
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)
git clone -q $name_or_url $OMF_PATH/$parent_path/$local_name
and echo (omf::em)"✔ $local_name $install_type succesfully installed."(omf::off)
or begin
echo (omf::err)"$local_name is not a valid $install_type."(omf::off) 1^&2
return $OMF_INVALID_ARG
end
end
return 0
end
if test -e $OMF_PATH/$target
echo (omf::dim)"Updating $name_or_url $install_type..."(omf::off)
pushd $OMF_PATH/$target
omf.util_sync "origin" >/dev/null ^&1
popd
echo (omf::em)"✔ $name_or_url $install_type up to date."(omf::off)
else
echo (omf::dim)"Installing $name_or_url $install_type..."(omf::off)
git clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target >/dev/null ^&1
and echo (omf::em)"✔ $name_or_url $install_type successfully installed."(omf::off)
or begin
echo (omf::err)"Could not install $install_type."(omf::off) 1^&2
return $OMF_UNKNOWN_ERR
end
end
end
pkg/omf/cli/omf.install_package.fish
View file @
c6e72863
function omf.install_package
for search in $argv
if test -e $OMF_PATH/db/pkg/$search
set target pkg/$search
else if test -e $OMF_PATH/db/themes/$search
set target themes/$search
else
set -l pkg (basename $search)
if test -e $OMF_PATH/pkg/$pkg
echo (omf::err)"Error: $pkg already installed."(omf::off) 1^&2
else
echo (omf::dim)"Trying to clone from URL..."(omf::err)
git clone -q $search $OMF_PATH/pkg/$pkg
and echo (omf::em)"✔ $pkg succesfully installed."(omf::off)
or echo (omf::err)"$pkg is not a valid package/theme."(omf::off) 1^&2
end
continue
end
if test -e $OMF_PATH/$target
echo (omf::dim)"Updating $search..."(omf::off)
pushd $OMF_PATH/$target
omf.util_sync "origin" >/dev/null ^&1
popd
echo (omf::em)"✔ $search up to date."(omf::off)
else
echo (omf::dim)"Installing $search..."(omf::off)
git clone (cat $OMF_PATH/db/$target) $OMF_PATH/$target >/dev/null ^&1
and echo (omf::em)"✔ $search succesfully installed."(omf::off)
or echo (omf::err)"Could not install package."(omf::off) 1^&2
end
omf.install --pkg $search
end
end
pkg/omf/cli/omf.theme.fish
View file @
c6e72863
function omf.theme
if not test -e $OMF_CONFIG/themes/$argv[1]
if not test -e $OMF_PATH/themes/$argv[1]
set -l theme $OMF_PATH/db/themes/$argv[1]
if test -e $theme
echo (omf::dim)"Downloading $argv[1] theme..."(omf::off)
git clone (cat $theme) $OMF_PATH/themes/$argv[1] >/dev/null ^&1
and echo (omf::em)"$argv[1] theme downloaded."(omf::off)
or return $OMF_UNKNOWN_ERR
else
echo (omf::err)"$argv[1] is not a valid theme"(omf::off) 1^&2
return $OMF_INVALID_ARG
end
end
omf.install --theme $argv[1]
end
echo "$argv[1]" > $OMF_CONFIG/theme
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