Ticket #29730: tortoisehg_ssh-askpass.diff

File tortoisehg_ssh-askpass.diff, 1.3 KB (added by shiena.jp@…, 13 years ago)
  • files/macos-askpass

     
     1#! /bin/sh 
     2
     3#
     4# An SSH_ASKPASS command for MacOS X
     5#
     6# Author: Joseph Mocker, Sun Microsystems 
     7
     8#
     9# To use this script:
     10#     setenv SSH_ASKPASS "macos-askpass"
     11#     setenv DISPLAY ":0"
     12
     13
     14TITLE=${MACOS_ASKPASS_TITLE:-"SSH"} 
     15
     16DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
     17DIALOG="$DIALOG with icon caution with hidden answer" 
     18
     19result=`osascript -e 'tell application "Finder"' -e "activate"  -e "$DIALOG" -e 'end tell'` 
     20
     21if [ "$result" = "" ]; then
     22    exit 1
     23else
     24    echo "$result" | sed -e 's/^text returned://' -e 's/, button returned:.*$//'
     25    exit 0
     26fi 
     27
  • files/TortoiseHg.in

    Property changes on: files/macos-askpass
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
    11#!/bin/bash
    22
     3if [ -z "$SSH_ASKPASS" ]; then
     4        SSH_ASKPASS=`dirname $0`/macos-askpass
     5        export SSH_ASKPASS
     6fi
     7
    38exec "@PREFIX@/bin/thg"