Skip to content

Commit eb7f112

Browse files
authored
Apply suggestions from code review
Co-authored-by: Nick Boldt <nboldt@redhat.com>
1 parent f94d449 commit eb7f112

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

modules/extend_dynamic-plugins-reference/rhdh-supported-plugins.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ fi
115115
fetch_catalog_index() {
116116
local image="${CATALOG_INDEX_REGISTRY}/plugin-catalog-index:${INDEX_TAG}"
117117
if ! command -v skopeo >/dev/null 2>&1; then
118-
echo -e "${red}[ERROR] skopeo is required but not found.${norm}"
118+
echo -e "${red}[ERROR] skopeo is required but not found.${norm}" >&2
119119
exit 1
120120
fi
121121
if ! command -v jq >/dev/null 2>&1; then
122-
echo -e "${red}[ERROR] jq is required but not found.${norm}"
122+
echo -e "${red}[ERROR] jq is required but not found.${norm}" >&2
123123
exit 1
124124
fi
125125
echo -e "${green}Fetching $image...${norm}"
@@ -134,6 +134,7 @@ fetch_catalog_index() {
134134
tar xf "$unpack/$layer" -C "$catalogindextmpdir"
135135
done
136136
rm -rf "$unpack" "$archive"
137+
exit 0
137138
}
138139

139140
generate_dynamic_plugins_table() {
@@ -148,12 +149,12 @@ generate_dynamic_plugins_table() {
148149
)
149150
ls ${catalogindextmpdir}
150151
if [[ ! -d "$src" ]]; then
151-
echo -e "${red}[ERROR] Missing directory in catalog index image: $src${norm}"
152+
echo -e "${red}[ERROR] Missing directory in catalog index image: $src${norm}" >&2
152153
exit 1
153154
fi
154155
for f in "${files[@]}"; do
155156
if [[ ! -f "$src/$f" ]]; then
156-
echo -e "${red}[ERROR] Missing file in catalog index image: $src/$f${norm}"
157+
echo -e "${red}[ERROR] Missing file in catalog index image: $src/$f${norm}" >&2
157158
exit 1
158159
fi
159160
cp "$src/$f" "${SCRIPT_DIR}/$f"

0 commit comments

Comments
 (0)