Created
October 17, 2018 17:22
-
-
Save alexproca/d2fa9af06b23ae19dc06c13a6eabb59a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
search_term=${1-local/} | |
helm update;helm search $search_term | sed -n '1!p' | awk -v login=$2 '{\ | |
v_count=split($2, versionArray, ".");\ | |
q_count=split(versionArray[3], qualifierArray, "-");\ | |
qualifierArray[1]=qualifierArray[1]+1;\ | |
qualifier=qualifierArray[1];\ | |
for(i=2;i<=q_count;i++)\ | |
qualifier = qualifier "-" qualifierArray[i];\ | |
versionArray[3] = qualifier;\ | |
updated_version=versionArray[1];\ | |
for(i=2;i<=v_count;i++)\ | |
updated_version = updated_version "." versionArray[i];\ | |
print updated_version;\ | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment