Skip to content

Commit 5e2b7f6

Browse files
authored
export: potential improvement to pull-request #1102 (#1608)
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`
1 parent 07c87ba commit 5e2b7f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

distrobox-export

+4-4
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,10 @@ export_application()
450450
# by its launcher name.
451451
desktop_files=$(
452452
# shellcheck disable=SC2086
453-
find ${canon_dirs} -type f -print -o -type l -print | sed 's/./\\&/g' |
454-
xargs -I{} grep -l -e "Exec=.*${exported_app}.*" -e "Name=.*${exported_app}.*" "{}" | sed 's/./\\&/g' |
455-
xargs -I{} grep -L -e "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox.*enter"}.*" "{}" | sed 's/./\\&/g' |
456-
xargs -I{} printf "%s¤" "{}"
453+
find "${canon_dirs}" -type f -print0 -o -type l -print0 |
454+
xargs -0 -I{} grep -l -e "Exec=.*${exported_app}.*" -e "Name=.*${exported_app}.*" "{}" |
455+
xargs -0 -I{} grep -L -e "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox-enter"}.*" "{}" |
456+
xargs -0 -I{} printf "%s@" "{}"
457457
)
458458
fi
459459

0 commit comments

Comments
 (0)