mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-22 12:43:23 +08:00
Report up-to-date packages as such
This commit is contained in:
parent
f6b9bdd941
commit
720c499e61
|
@ -1,19 +1,24 @@
|
|||
function omf.packages.update -a name
|
||||
if set target_path (omf.packages.path $name)
|
||||
# Skip packages outside version control
|
||||
not test -e $target_path/.git;
|
||||
and return 0
|
||||
|
||||
if omf.repo.pull $target_path
|
||||
omf.bundle.install $target_path/bundle
|
||||
echo (omf::em)"$name successfully updated."(omf::off)
|
||||
return 0
|
||||
else
|
||||
echo (omf::err)"Could not update $name."(omf::off) 1^&2
|
||||
end
|
||||
else
|
||||
echo (omf::err)"Could not find $name."(omf::off) 1^&2
|
||||
if not set target_path (omf.packages.path $name)
|
||||
echo (omf::err)"Could not find $name."(omf::off) 1>&2
|
||||
return 1
|
||||
end
|
||||
|
||||
return 1
|
||||
# Skip packages outside version control
|
||||
not test -e $target_path/.git;
|
||||
and return 0
|
||||
|
||||
omf.repo.pull $target_path
|
||||
switch $status
|
||||
case 0
|
||||
omf.bundle.install $target_path/bundle
|
||||
echo (omf::em)"$name successfully updated."(omf::off)
|
||||
case 1
|
||||
echo (omf::err)"Could not update $name."(omf::off) 1>&2
|
||||
return 1
|
||||
case 2
|
||||
echo (omf::dim)"$name is already up-to-date."(omf::off)
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user