From fd3f6f860a1b88d39ec59e0a59cfd53a5f89b7f3 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 7 Apr 2012 21:58:39 +0000 Subject: UTF-8 feature in publish. wow git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@517 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- publish | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'publish') diff --git a/publish b/publish index 294fe4c..16d8024 100755 --- a/publish +++ b/publish @@ -67,12 +67,13 @@ usage: $0 [ [ ...]] copy the file to a server an report the URL. OPTIONS: - -n no-do. Just print what would have been done - -H Show the history + -n no-do. Just print what would have been done. + -H Show the history. -S Make a screenshot of one window and publish. - -x Publish the contents of the xclipboard - -h Show this message - -q Produce a QR code + -x Publish the contents of the xclipboard. + -h Show this message. + -q Produce a QR code. + -8 Add a AddDefaultCharset UTF-8 .htaccess file. EOF } @@ -109,8 +110,9 @@ NODO="" inputxclip=0 do_screenshot=0 make_qrcode=0 +add_default_cs=0 -while getopts "hnqHSxs:" OPTION +while getopts "hnq8HSxs:" OPTION do case $OPTION in h) @@ -126,6 +128,9 @@ do x) inputxclip=1 ;; + 8) + add_default_cs=1 + ;; H) if [ -r "$history_file" ]; then history_show @@ -218,14 +223,21 @@ if [ "$make_qrcode" -gt 0 ] ; then setup_tmpdir img="$tmpdir/.qr.png" echo -n "$main_uri" | qrencode -s 5 -l H -o "$img" - $NODO rsync $rsync_args "$img" $base_rsync"/$d_server/" echo "$base_uri"".qr.png" main_uri="$base_uri"".qr.png" + set dummy "$img" "$@" + shift else echo >&2 "Warning: qrencode not found." fi fi +if [ "$add_default_cs" -gt 0 ] ; then + echo 'AddDefaultCharset UTF-8' > "$tmpdir/.htaccess" + set dummy "$tmpdir/.htaccess" "$@" + shift +fi + if command -v xclip >/dev/null 2>&1; then echo -n "$main_uri" | xclip fi -- cgit v1.2.3