Skip to content

Commit

Permalink
export: potential improvement to pull-request #1102 (#1608)
Browse files Browse the repository at this point in the history
I ran into an issue when exporting. I mentioned it here: #1097 (comment)

I have reworked a small part of the code to utilize the `-0` option of `xargs`
  • Loading branch information
AbduEhab authored Jan 19, 2025
1 parent 07c87ba commit 5e2b7f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ export_application()
# by its launcher name.
desktop_files=$(
# shellcheck disable=SC2086
find ${canon_dirs} -type f -print -o -type l -print | sed 's/./\\&/g' |
xargs -I{} grep -l -e "Exec=.*${exported_app}.*" -e "Name=.*${exported_app}.*" "{}" | sed 's/./\\&/g' |
xargs -I{} grep -L -e "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox.*enter"}.*" "{}" | sed 's/./\\&/g' |
xargs -I{} printf "%s¤" "{}"
find "${canon_dirs}" -type f -print0 -o -type l -print0 |
xargs -0 -I{} grep -l -e "Exec=.*${exported_app}.*" -e "Name=.*${exported_app}.*" "{}" |
xargs -0 -I{} grep -L -e "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox-enter"}.*" "{}" |
xargs -0 -I{} printf "%s@" "{}"
)
fi

Expand Down

0 comments on commit 5e2b7f6

Please sign in to comment.