@@ -20,9 +20,22 @@ set -o pipefail # make the pipeline fail if any command in it fails.
2020REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
2121
2222source_tilt_settings () {
23- if [ " $# " -ne 1 ]; then
24- echo " Usage: $0 <tilt-settings.yaml>"
25- exit 1
23+
24+ found=false
25+ # echo "checking for tilt-settings.yaml..."
26+ # echo "args: $@"
27+ for arg in " $@ " ; do
28+ if [ " $arg " == " tilt-settings.yaml" ]; then
29+ found=true
30+ break
31+ fi
32+ done
33+
34+ if [ " $found " == true ]; then
35+ echo " tilt-settings.yaml was passed as an argument."
36+ else
37+ echo " tilt-settings.yaml was not found."
38+ exit 1
2639 fi
2740
2841 TILT_SETTINGS_FILE=" $1 "
@@ -33,18 +46,18 @@ source_tilt_settings() {
3346 exit 1
3447 fi
3548
36- echo " Reading variables from $TILT_SETTINGS_FILE under 'kustomize_substition '..."
49+ echo " Reading variables from $TILT_SETTINGS_FILE under 'kustomize_substitutions '..."
3750
38- # Get the list of keys under kustomize_substition
39- VAR_KEYS=$( yq e ' .kustomize_substition | keys | .[]' " $TILT_SETTINGS_FILE " 2> /dev/null || true)
51+ # Get the list of keys under kustomize_substitutions
52+ VAR_KEYS=$( yq e ' .kustomize_substitutions | keys | .[]' " $TILT_SETTINGS_FILE " 2> /dev/null || true)
4053
4154 # If there's no such key or it's empty, VAR_KEYS will be empty
4255 if [ -z " $VAR_KEYS " ]; then
43- echo " No variables found under 'kustomize_substition '."
56+ echo " No variables found under 'kustomize_substitutions '."
4457 else
4558 for key in $VAR_KEYS ; do
4659 # Read the value of each key
47- value=$( yq e " .kustomize_substition [\" $key \" ]" " $TILT_SETTINGS_FILE " )
60+ value=$( yq e " .kustomize_substitutions [\" $key \" ]" " $TILT_SETTINGS_FILE " )
4861 # Export the key/value pair
4962 export " $key =$value "
5063 echo " Exported $key =$value "
0 commit comments