Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
🐞 fix(module): fix image-cleaner module (again)
Browse files Browse the repository at this point in the history
Each variable in the array has a newline character at the end of the string. Because of this, the module was unable to delete the provided entries/repositories
  • Loading branch information
c0deplayer committed Oct 10, 2023
1 parent c3f19eb commit f06ca7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/image-cleaner/image-cleaner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ get_yaml_array ENTRIES '.entries[]' "$1"
if [[ ${#ENTRIES[@]} -gt 0 ]]; then
echo "Removing desktop entries..."
for entry in "${ENTRIES[@]}"; do
entry="$(echo "$entry" | tr -d '\n')"
desktop_file="/usr/share/applications/${entry}.desktop"

if [[ -f "$desktop_file" ]]; then
Expand All @@ -22,6 +23,7 @@ get_yaml_array REPOS '.repos[]' "$1"
if [[ ${#REPOS[@]} -gt 0 ]]; then
echo "Removing repositories..."
for repo in "${REPOS[@]}"; do
repo="$(echo "$repo" | tr -d '\n')"
repo_file="/etc/yum.repos.d/${repo}.repo"

if [[ -f "$repo_file" ]]; then
Expand Down

0 comments on commit f06ca7d

Please sign in to comment.