@@ -144,11 +144,11 @@ update_os_pkg() {
144144 debian)
145145 if [ " $( find /var/lib/apt/lists/* -maxdepth 1 -check_cmd f 2> /dev/null | wc -l) " -eq 0 ]; then
146146 println " Updating ${PKG_MGR_CMD} based packages..."
147- if ! (${PKG_MGR_CMD} update -y &&
148- ${PKG_MGR_CMD} upgrade -y &&
149- ${PKG_MGR_CMD} dist-upgrade -y &&
150- ${PKG_MGR_CMD} autoremove -y &&
151- ${PKG_MGR_CMD} autoclean -y); then
147+ if ! (" ${PKG_MGR_CMD} " update -y &&
148+ " ${PKG_MGR_CMD} " upgrade -y &&
149+ " ${PKG_MGR_CMD} " dist-upgrade -y &&
150+ " ${PKG_MGR_CMD} " autoremove -y &&
151+ " ${PKG_MGR_CMD} " autoclean -y); then
152152 print_err " Error: Update failed."
153153 fi
154154 fi
@@ -159,13 +159,13 @@ update_os_pkg() {
159159 if [ " ${PKG_MGR_CMD} " = " microdnf" ]; then
160160 if [ " $( find /var/cache/yum/* -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null | wc -l) " -eq 0 ]; then
161161 println " Running ${PKG_MGR_CMD} makecache..."
162- ${PKG_MGR_CMD} makecache
162+ " ${PKG_MGR_CMD} " makecache
163163 fi
164164 else
165165 if [ " $( find " /var/cache/${PKG_MGR_CMD} " /* -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null | wc -l) " -eq 0 ]; then
166166 println " Running ${PKG_MGR_CMD} check-update..."
167167 set +e
168- ${PKG_MGR_CMD} check-update
168+ " ${PKG_MGR_CMD} " check-update
169169 rc=$?
170170 if [ $rc -ne 0 ] && [ $rc -ne 100 ]; then
171171 exit 1
@@ -175,25 +175,25 @@ update_os_pkg() {
175175 fi
176176
177177 println " Updating ${PKG_MGR_CMD} based packages..."
178- if ! (${PKG_MGR_CMD} update -y &&
179- ${PKG_MGR_CMD} upgrade -y &&
180- ${PKG_MGR_CMD} autoremove -y); then
178+ if ! (" ${PKG_MGR_CMD} " update -y &&
179+ " ${PKG_MGR_CMD} " upgrade -y &&
180+ " ${PKG_MGR_CMD} " autoremove -y); then
181181 print_err " Error: Update failed."
182182 fi
183183 ;;
184184 alpine)
185185 if [ " $( find /var/cache/apk/* 2> /dev/null | wc -l) " -eq 0 ]; then
186186 println " Updating ${PKG_MGR_CMD} based packages..."
187- if ! (${PKG_MGR_CMD} update && ${PKG_MGR_CMD} upgrade); then
187+ if ! (" ${PKG_MGR_CMD} " update && " ${PKG_MGR_CMD} " upgrade); then
188188 print_err " Error: Update failed."
189189 fi
190190 fi
191191 ;;
192192 arch)
193193 if [ " $( find /var/cache/pacman/pkg/* 2> /dev/null | wc -l) " -eq 0 ]; then
194194 println " Updating ${PKG_MGR_CMD} based packages..."
195- if ! (${PKG_MGR_CMD} -Syu --noconfirm &&
196- ${PKG_MGR_CMD} -Rns " $( ${PKG_MGR_CMD} -Qdtq) " ); then
195+ if ! (" ${PKG_MGR_CMD} " -Syu --noconfirm &&
196+ " ${PKG_MGR_CMD} " -Rns " $( " ${PKG_MGR_CMD} " -Qdtq) " ); then
197197 print_err " Error: Update failed."
198198 fi
199199 fi
@@ -306,16 +306,16 @@ install_pkg() {
306306 if ! check_command " ${pkg_name} " ; then
307307 case ${ADJUSTED_ID} in
308308 debian)
309- ${PKG_MGR_CMD} update && ${INSTALL_CMD} " ${pkg_name} "
309+ " ${PKG_MGR_CMD} " update && " ${INSTALL_CMD} " " ${pkg_name} "
310310 ;;
311311 rhel)
312- ${PKG_MGR_CMD} update && ${INSTALL_CMD} " ${pkg_name} "
312+ " ${PKG_MGR_CMD} " update && " ${INSTALL_CMD} " " ${pkg_name} "
313313 ;;
314314 alpine)
315- ${PKG_MGR_CMD} update && ${INSTALL_CMD} " ${pkg_name} "
315+ " ${PKG_MGR_CMD} " update && " ${INSTALL_CMD} " " ${pkg_name} "
316316 ;;
317317 arch)
318- ${INSTALL_CMD} " ${pkg_name} "
318+ " ${INSTALL_CMD} " " ${pkg_name} "
319319 ;;
320320 * )
321321 print_err " Error: Unable to install ${pkg_name} for distro ${ID} "
0 commit comments