diff options
-rw-r--r-- | .install | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.install b/.install new file mode 100644 index 000000000000..3175089967d0 --- /dev/null +++ b/.install @@ -0,0 +1,36 @@ + +# protote at /usr/share/pacman/proto.install +post_remove() { + # remove + # sudo rm -f ${which tempest} + # sudo rm /usr/bin/tempest + + goclean github.com/ChacaS0/tempest +} + +goclean() { + local pkg=$1; shift || return 1 + local ost + local cnt + local scr + + # Clean removes object files from package source directories (ignore error) + go clean -i $pkg &>/dev/null + + # Set local variables + [[ "$(uname -m)" == "x86_64" ]] \ + && ost="$(uname)";ost="${ost,,}_amd64" \ + && cnt="${pkg//[^\/]}" + + # Delete the source directory and compiled package directory(ies) + if (("${#cnt}" == "2")); then + rm -rf "${GOPATH%%:*}/src/${pkg%/*}" + rm -rf "${GOPATH%%:*}/pkg/${ost}/${pkg%/*}" + elif (("${#cnt}" > "2")); then + rm -rf "${GOPATH%%:*}/src/${pkg%/*/*}" + rm -rf "${GOPATH%%:*}/pkg/${ost}/${pkg%/*/*}" + fi + + # Reload the current shell + source ~/.bashrc +} |