summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChacaS02018-09-13 21:29:36 +0400
committerChacaS02018-09-13 21:29:36 +0400
commit1240e291126c46c9150ed9619c45e58c0c41d3c4 (patch)
tree289b141f02a34c3008fc2cc7b14d3755d0181962
parent72e97875a6f97e25552ff9948063397de47a61c6 (diff)
downloadaur-tempest.tar.gz
:heavy_check_mark: Added .install --> post_remove
:memo: [TODO] Tests
-rw-r--r--.install36
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
+}