2015-12-20 17:57:51 -02:00
|
|
|
function omf.packages.update -a name
|
2016-01-14 23:32:12 +02:00
|
|
|
if not set target_path (omf.packages.path $name)
|
|
|
|
echo (omf::err)"Could not find $name."(omf::off) 1>&2
|
|
|
|
return 1
|
|
|
|
end
|
|
|
|
|
|
|
|
# Skip packages outside version control
|
|
|
|
not test -e $target_path/.git;
|
|
|
|
and return 0
|
2015-12-20 17:57:51 -02:00
|
|
|
|
2016-01-14 23:32:12 +02:00
|
|
|
omf.repo.pull $target_path
|
|
|
|
switch $status
|
|
|
|
case 0
|
2015-12-20 17:57:51 -02:00
|
|
|
omf.bundle.install $target_path/bundle
|
|
|
|
echo (omf::em)"$name successfully updated."(omf::off)
|
2016-01-14 23:32:12 +02:00
|
|
|
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)
|
2015-12-20 17:57:51 -02:00
|
|
|
end
|
|
|
|
|
2016-01-14 23:32:12 +02:00
|
|
|
return 0
|
2015-12-20 17:57:51 -02:00
|
|
|
end
|