[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/comint-mime 1fc5680229: Make comint-mime.sh more portab
From: |
ELPA Syncer |
Subject: |
[elpa] externals/comint-mime 1fc5680229: Make comint-mime.sh more portable |
Date: |
Sun, 14 Aug 2022 06:57:20 -0400 (EDT) |
branch: externals/comint-mime
commit 1fc568022927477ef268df53d4587ab6872917f8
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Make comint-mime.sh more portable
Closes #3.
Closes #9.
---
comint-mime.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/comint-mime.sh b/comint-mime.sh
index b718aac86a..9cbb3925fc 100644
--- a/comint-mime.sh
+++ b/comint-mime.sh
@@ -6,7 +6,7 @@ mimecat () {
local file
case "$1" in
-h|--help)
- echo "Usage: mimecat [-t TYPE] [FILE]"
+ echo >&2 "Usage: mimecat [-t TYPE] [FILE]"
return 0
;;
-t|--type)
@@ -16,14 +16,14 @@ mimecat () {
esac
if [ -z "$1" ]; then
if [ -z "$type" ]; then
- echo "mimecat: When reading from stdin, please provide -t TYPE"
+ echo >&2 "mimecat: When reading from stdin, please provide -t TYPE"
return 1
fi
base64 | xargs -0 printf '\033]5151;{"type":"%s"}\n%s\033\\\n' "$type"
else
file=$(realpath -e "$1") || return 1
- [ -n "$type" ] || type=$(file -bi "$file")
+ [ -n "$type" ] || type=$(file -b --mime "$file")
printf '\033]5151;{"type":"%s"}\nfile://%s%s\033\\\n' \
- "$type" "$(hostname)" "$file"
+ "$type" "$(uname -n)" "$file"
fi
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/comint-mime 1fc5680229: Make comint-mime.sh more portable,
ELPA Syncer <=