Browse Source

ix: remove trailing newline when copying to clipboard

pull/6/head
DanielFGray 5 years ago
parent
commit
2ee44cc9fa
  1. 6
      ix

6
ix

@ -4,7 +4,7 @@ declare -r esc=$'\033' @@ -4,7 +4,7 @@ declare -r esc=$'\033'
declare -r c_reset="${esc}[0m"
declare -r c_red="${esc}[31m"
declare OPTIND
declare opts=( -# )
declare -a opts=( -\# )
declare id
usage() {
@ -141,9 +141,9 @@ if [[ -t 0 ]]; then @@ -141,9 +141,9 @@ if [[ -t 0 ]]; then
filename="$1"
shift
response=$(curl "${opts[@]}" -F f:1=@"$filename" "$@" "ix.io/$id")
clipboard=$(select_from 'xclip' 'xsel')
clipboard=$(select_from 'xclip -r ' 'xsel')
if [[ -n "$clipboard" ]]; then
tee <<< "$response" | $clipboard
tee /dev/tty <<< "$response" | $clipboard
else
echo "$response"
fi

Loading…
Cancel
Save