@@ -88,18 +88,21 @@ gh_client_config_dir="${HOME}/.config/gh"
88
88
gh_client_config_path=" ${gh_client_config_dir} /config.yml"
89
89
gh_client_config_backup_path=" ${gh_client_config_dir} /config.yml.backup"
90
90
91
+ mkdir -p " ${gh_client_config_dir} "
92
+
91
93
restore_gh_config () {
92
94
if [[ -f " ${gh_client_config_backup_path} " ]]; then
93
95
echo -e " 🥑 Restore gh cli configuration"
94
96
mv -f " ${gh_client_config_backup_path} " " ${gh_client_config_path} " || :
95
97
fi
96
98
}
97
99
98
- trap restore_gh_config EXIT
99
100
100
- echo " Backing up existing configuration"
101
- mkdir -p " ${gh_client_config_dir} "
102
- mv -f " ${gh_client_config_path} " " ${gh_client_config_backup_path} "
101
+ if [[ -e " ${gh_client_config_path} " ]]; then
102
+ echo " Backing up existing configuration"
103
+ mv -f " ${gh_client_config_path} " " ${gh_client_config_backup_path} "
104
+ trap restore_gh_config EXIT
105
+ fi
103
106
104
107
echo " Writing custom configuration"
105
108
cat << EOF > "${gh_client_config_path} "
@@ -133,8 +136,8 @@ echo -e "🥑 Check whether chart is in sync"
133
136
134
137
eks_charts_nth_path=" ${eks_charts_repo_path} /stable/${helm_chart_name} "
135
138
if diff -x " .*" -r " ${helm_chart_path} /" " ${eks_charts_nth_path} /" & > /dev/null ; then
136
- echo " ✅ Charts already in sync; no updates needed"
137
- exit
139
+ echo " ✅ Charts already in sync; no updates needed"
140
+ exit
138
141
fi
139
142
140
143
echo -e " 🚨 Charts are NOT in sync"
0 commit comments