From 03289e5bc81255ef495f97950e55caf7ab5fc7c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio <23226432+hyperreal64@users.noreply.github.com> Date: Sun, 26 Feb 2023 03:44:31 -0600 Subject: [PATCH] Add notmuch from distrobox-export --- notmuch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 notmuch diff --git a/notmuch b/notmuch new file mode 100755 index 0000000..3eb681d --- /dev/null +++ b/notmuch @@ -0,0 +1,24 @@ +#!/bin/sh +# distrobox_binary +# name: default +if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then + command="/bin/distrobox-enter -n default -- /bin/notmuch " + + for arg in "$@"; do + if echo "${arg}" | grep -Eq "'|\""; then + command="${command} \ + $(echo "${arg}" | sed 's|\\|\\\\|g' | + sed 's| |\\ |g' | + sed 's|\$|\\\$|g' | + sed "s|'|\\\'|g" | + sed 's|"|\\\"|g')" + elif echo "${arg}" | grep -q "'"; then + command="${command} \"${arg}\"" + else + command="${command} '${arg}'" + fi + done + eval ${command} +else + /bin/notmuch "$@" +fi