@@ -320,32 +320,21 @@ delete_container() {
320
320
;;
321
321
esac
322
322
323
- IFS=' @'
323
+ IFS='
324
+ '
325
+ printf " Removing exported binaries...\n"
324
326
# Remove exported binaries from this container in default path
325
- binary_files=" $( grep -rl " # distrobox_binary" " ${HOME} /.local/bin" 2> /dev/null | sed ' s/./\\&/g' |
326
- xargs -I{} grep -le " # name: ${container_name} $" " {}" | sed ' s/./\\&/g' |
327
- xargs -I{} printf " %s@" " {}" 2> /dev/null || :) "
328
- for file in ${binary_files} ; do
329
- printf " Removing exported binary %s...\n" " ${file} "
330
- rm -f " ${file} "
327
+ for i in $( " $( dirname " $( realpath " ${0} " ) " ) /distrobox-enter" " ${container_name} " -- distrobox-export --list-binaries) ; do
328
+ bin=" $( echo " ${i} " | cut -d' |' -f1 | sed ' s/[ ]*$//' | sed ' s/^[ ]*//' ) "
329
+ dir=" $( echo " ${i} " | cut -d' |' -f2- | sed ' s/[ ]*$//' | sed ' s/^[ ]*//' ) "
330
+ " $( dirname " $( realpath " ${0} " ) " ) /distrobox-enter" " ${container_name} " -- distrobox-export --bin " ${bin} " --export-path " $( dirname " ${dir} " ) " --delete
331
331
done
332
332
333
333
# Remove exported gui apps from this container in default path
334
- # shellcheck disable=SC2086,SC2038
335
- desktop_files=" $( find " ${HOME} /.local/share/applications/${container_name} " * -type f -o -type l 2> /dev/null | sed ' s/./\\&/g' |
336
- xargs -I{} grep -le " Exec=.*${container_name} " " {}" | sed ' s/./\\&/g' |
337
- xargs -I{} printf " %s@" " {}" 2> /dev/null || :) "
338
- for file in ${desktop_files} ; do
339
- if [ -e " ${file} " ]; then
340
- app=" $( grep -Eo " Name=.*" " ${file} " | head -n 1 | cut -d' ' -f1 | cut -d' =' -f2) "
341
-
342
- printf " Removing exported app %s...\n" " ${app} "
343
- " $( dirname " $( realpath " ${0} " ) " ) /distrobox-enter" " ${container_name} " -- distrobox-export --delete --app " ${app} " > /dev/null 2> /dev/null || :
344
- fi
345
- done
346
- IFS=' '
334
+ " $( dirname " $( realpath " ${0} " ) " ) /distrobox-enter" " ${container_name} " -- sh -c " distrobox-export --list-apps | cut -d'|' -f1 | sed 's/[ ]*$//' | xargs -I{} distrobox-export --app \" {}\" -d"
347
335
348
336
# Remove the container
337
+ printf " Removing exported apps...\n"
349
338
# shellcheck disable=SC2086,SC2248
350
339
${container_manager} rm ${force_flag} " ${container_name} "
351
340
0 commit comments