Skip to content

Commit

Permalink
feat: call make uninstall and remove from install_manifest.txt on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
psprint committed Apr 29, 2023
1 parent 6d84f99 commit f190424
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions zinit-autoload.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,17 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
} # ]]]
# FUNCTION: .zinit-run-delete-hooks [[[
.zinit-run-delete-hooks() {
# Call make uninstall if it's available
local make_path=$5/Makefile mfest_path=$5/_build-zinit/install_manifest.txt
[[ -f $make_path ]] && \
grep '^uninstall:' $make_path &>/dev/null && \
{ +zinit-message {pre}Running {cmd}make uninstall{pre}{…}
make -C "$make_path:h" uninstall;}
[[ -f $mfest_path ]] && \
{ +zinit-message {pre}Removing files from:{file} \
$mfest_path:t{pre}{…}
command xargs rm -f <$mfest_path
}
if [[ -n ${ICE[atdelete]} ]]; then
.zinit-countdown "atdelete" && ( (( ${+ICE[nocd]} == 0 )) && \
{ builtin cd -q "$5" && eval "${ICE[atdelete]}"; ((1)); } || \
Expand Down

0 comments on commit f190424

Please sign in to comment.