add potentially absent go/bin
[webi-installers/.git] / golang / install.bash
index 2ded9df92b523403be0bbfec92d2885f7d95f760..d31304466886c8159807e9bf1f1d6a10a1d2f97a 100644 (file)
@@ -40,18 +40,19 @@ set -u
 ###################
 
 new_go="${HOME}/.local/opt/go-v${WEBI_VERSION}/bin/go"
-common_go_home="${HOME}/.local/opt/go-v${WEBI_VERSION}"
+common_go_home="${HOME}/.local/opt/go"
 new_go_home="${HOME}/.local/opt/go-v${WEBI_VERSION}"
 common_go_bin="${HOME}/go"
 new_go_bin="${HOME}/.local/opt/go-bin-v${WEBI_VERSION}"
 
 update_go_home() {
-    rm -rf "$common_go_home"
+    rm -rf "$common_go_home" # should be a symlink
     ln -s "$new_go_home" "$common_go_home"
     # TODO get better output from pathman / output the path to add as return to webi bootstrap
     webi_path_add "$common_go_home/bin"
 
     rm -rf "$common_go_bin"
+    mkdir -p "$new_go_bin/bin"
     ln -s "$new_go_bin" "$common_go_bin"
     webi_path_add "$common_go_bin/bin"
 }