mirror of
https://github.com/jorgebucaran/fisher
synced 2024-06-28 23:01:50 +02:00
refactor: improve commit error msg when fishfile is not empty
This commit is contained in:
parent
8f42f7abdf
commit
2ead99f732
|
@ -163,7 +163,8 @@ function _fisher_commit
|
||||||
command mv -f $fishfile@ $fishfile
|
command mv -f $fishfile@ $fishfile
|
||||||
command rm -f $fishfile@
|
command rm -f $fishfile@
|
||||||
|
|
||||||
set -l added_pkgs (_fisher_pkg_fetch_all (_fisher_fishfile_load < $fishfile))
|
set -l expected_pkgs (_fisher_fishfile_load < $fishfile)
|
||||||
|
set -l added_pkgs (_fisher_pkg_fetch_all $expected_pkgs)
|
||||||
set -l updated_pkgs (
|
set -l updated_pkgs (
|
||||||
for pkg in $removed_pkgs
|
for pkg in $removed_pkgs
|
||||||
set pkg (echo $pkg | command sed "s|$fisher_config/||")
|
set pkg (echo $pkg | command sed "s|$fisher_config/||")
|
||||||
|
@ -172,7 +173,7 @@ function _fisher_commit
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if test -z "$added_pkgs$updated_pkgs$removed_pkgs" -a ! -s "$fishfile"
|
if test -z "$added_pkgs$updated_pkgs$removed_pkgs$expected_pkgs"
|
||||||
echo "nothing to commit -- try adding some packages" >&2
|
echo "nothing to commit -- try adding some packages" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue