Allow selective updates
parent
a0c6213b36
commit
fa24e67633
@ -1,12 +1,26 @@
|
|||||||
function omf.cli.update
|
function omf.cli.update
|
||||||
if omf.core.update
|
set -l update_core
|
||||||
echo (omf::em)"Oh My Fish is up to date."(omf::off)
|
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
|
else
|
||||||
echo (omf::err)"Oh My Fish failed to update."(omf::off)
|
set packages (omf.packages.list --installed)
|
||||||
echo "Please open a new issue here → "(omf::em)"github.com/oh-my-fish/oh-my-fish/issues"(omf::off)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for package in (omf.packages.list --installed)
|
if set -q update_core
|
||||||
|
if omf.core.update
|
||||||
|
echo (omf::em)"Oh My Fish is up to date."(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
|
||||||
|
|
||||||
|
for package in $packages
|
||||||
omf.packages.update $package
|
omf.packages.update $package
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue