mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 14:12:43 +08:00

Replace package database with independently installed package repositories - Add support for fetching and installing from package repositories containing package URLs and metadata - Support multiple package repository sources - Add new repo command - Remove submit command - Enhance describe and search commands - Fix and improve help text for new and adjusted commands - Fix bundle install exit status - Refer to plugins as "plugins" instead of the general term "packages" - Code clarity improvements - Put plugin/theme distinction into package metadata
42 lines
1.0 KiB
Fish
42 lines
1.0 KiB
Fish
function omf.cli.update
|
|
set -l update_core
|
|
set -l packages $argv
|
|
if test (count $packages) -gt 0
|
|
# If several packages are listed, only update core if "omf" is listed among them.
|
|
# Also keep "omf" out of the list of packages to update.
|
|
set index (contains -i -- omf $packages)
|
|
and set -e packages[$index]
|
|
or set -e update_core
|
|
else
|
|
set packages (omf.packages.list)
|
|
end
|
|
|
|
if set -q update_core
|
|
omf.core.update
|
|
|
|
if type -q omf.version
|
|
set OMF_VERSION (omf.version)
|
|
end
|
|
|
|
if test $status -ne 1
|
|
echo (omf::em)"Oh My Fish is up to date."(omf::off)
|
|
echo (omf::em)"You are now using Oh My Fish version $OMF_VERSION."(omf::off)
|
|
else
|
|
echo (omf::err)"Oh My Fish failed to update."(omf::off)
|
|
echo "Please open a new issue here → "(omf::em)"github.com/oh-my-fish/oh-my-fish/issues"(omf::off)
|
|
end
|
|
end
|
|
|
|
omf.index.update
|
|
or return 1
|
|
|
|
for package in $packages
|
|
omf.packages.update $package
|
|
end
|
|
|
|
# Opt-in flag for testing
|
|
if set -q OMF_AUTO_RELOAD
|
|
omf.cli.reload
|
|
end
|
|
end
|