#!/bin/sh # # git-url-handler: Handles git:// links in Web browsers. # # Copyright (c) 2009 Andrew Barr. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US DIRECTORY="`zenity --file-selection --directory --save`" if [ x"$?" != x"0" ]; then exit 1 fi cd $DIRECTORY # Zenity focus issues as described in http://bugzilla.gnome.org/show_bug.cgi?id=561131 zenity --progress --text="Checking out, please wait" --pulsate --auto-kill & ZPID="`jobs -p 1`" # get PID of progress dialog git clone $1 GIT_RETURN_CODE=$? kill $ZPID if [ x"$GIT_RETURN_CODE" != x"0" ]; then zenity --error --text="Subprocess exited with nonzero return code $GIT_RETURN_CODE." else nautilus $DIRECTORY fi