aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas C. Villa Real <lucasvr@gmail.com>2017-10-12 11:24:15 -0300
committerLucas C. Villa Real <lucasvr@gmail.com>2017-10-12 11:24:15 -0300
commit9cb4c43c2d7015ccc78db47b3fd3446f769de6ea (patch)
tree4de3f69672b274bfd1295f0832374c150b6af870
parent2df33657c0670bd1b6b3177a04cb71e15d02fcdd (diff)
downloadThirdPartyInstallers-9cb4c43c2d7015ccc78db47b3fd3446f769de6ea.tar.xz
If a package with the same name is already installed then reuse it to prevent CamelCaseInconsistencies.
-rwxr-xr-xbin/ThirdPartyInstaller5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/ThirdPartyInstaller b/bin/ThirdPartyInstaller
index 707f6e3..ba2dcdc 100755
--- a/bin/ThirdPartyInstaller
+++ b/bin/ThirdPartyInstaller
@@ -445,6 +445,11 @@ function prepare_program_entry() {
then Log_Normal "Program name is $(GuessProgramCase $programname)"
else Log_Normal "Program name is $programname"
fi
+
+ # If a package with the same name is already installed then reuse it to prevent CamelCaseInconsistencies
+ existing=$(ls $goboPrograms/ | grep -i "^${programname}$")
+ [ "$existing" ] && programname="$existing"
+
PrepareProgram -t "$programname" "$programversion"
programname=$(ls $goboPrograms/ | grep -i "^${programname}$")
target="$goboPrograms/$programname/$programversion"