Move getVersion line cleanup to main

This was catching comments of the format "Chart version for package:".
By moving the line cleanup (remove comments, prune whitespace) to be
before the case statement, we can be sure that comments won't trigger
the case statement, and that whitespace added before the colon for
aesthetic reasons don't need to be accounted for with a wildcard in
the glob.

Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I3f0a4c979d6da4e17bd65b3423f77df0c93fe47a
diff --git a/helmrepo.sh b/helmrepo.sh
index 3d36595..8f23a9a 100755
--- a/helmrepo.sh
+++ b/helmrepo.sh
@@ -104,11 +104,6 @@
 
     [[ -v debug ]] && func_echo "LINE: $line"
 
-    # foo=${string#"$prefix"}
-
-    line="${line%\#*}"            # Snip comments
-    line="${line//[[:blank:]]}"   # Prune whitespace
-
     # version : x.y.z
     readarray -d':' -t _fields < <(printf '%s' "$line")
 
@@ -363,11 +358,15 @@
             for line in "${chart_yaml_diff[@]}";
             do
                 [[ -v debug ]] && func_echo "$line"
+                
+                # foo=${string#"$prefix"}
+                line="${line%\#*}"            # Snip comments
+                line="${line//[[:blank:]]}"   # Prune whitespace
 
                 case "$line" in
                     # appVersion: "1.0.3"
                     # version: 1.2.3
-                    [-+]*[vV]ersion*:*) getVersion versions "$line" ;;
+                    [-+]*[vV]ersion:*) getVersion versions "$line" ;;
                 esac
             done