Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: xargs was breaking mid find search due to files with quotes on filename #1098

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ export_application() {
# by its launcher name.
desktop_files=$(
# shellcheck disable=SC2086,SC2038
find ${canon_dirs} -type f -printf "%p\n" -o -type l -printf '"%p"\n' |
xargs -I{} grep -le "Exec=.*${exported_app}.*" -le "Name=.*${exported_app}.*" "{}" |
xargs -I{} grep -Le "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox-enter"}.*" "{}" |
xargs -I{} printf "%s@" {}
find ${canon_dirs} -type f -printf "\"%p\" \n" -o -type l -printf "\"%p\" \n"|
xargs grep -le "Exec=.*${exported_app}.*" -le "Name=.*${exported_app}.*" "{}" |
xargs grep -Le "Exec=.*${DISTROBOX_ENTER_PATH:-"distrobox-enter"}.*" "{}" |
xargs printf "%s@" {}
)

# Ensure the app we're exporting is installed
Expand Down