From 99fe594d9677d55d773db3ab180310a3d3bf090b Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Wed, 10 Oct 2007 08:58:59 +0200 Subject: git-gui: add mingw specific startup wrapper The wrapper adds the directory it is installed in to PATH. This is required for the git commands implemented in shell. git-gui fails to launch them if PATH is not modified. The wrapper script also accepts an optional command line switch '--working-dir ' and changes to before launching the actual git-gui. This is required to implement the "Git Gui Here" Explorer shell extension. As a last step the original git-gui script is launched, which is expected to be located in the same directory under the name git-gui.tcl. Signed-off-by: Steffen Prohaska Signed-off-by: Shawn O. Pearce --- windows/git-gui.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 windows/git-gui.sh (limited to 'windows/git-gui.sh') diff --git a/windows/git-gui.sh b/windows/git-gui.sh new file mode 100644 index 000000000..98f32c0a0 --- /dev/null +++ b/windows/git-gui.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Tcl ignores the next line -*- tcl -*- \ +exec wish "$0" -- "$@" + +if { $argc >=2 && [lindex $argv 0] == "--working-dir" } { + cd [lindex $argv 1] + set argv [lrange $argv 2 end] + incr argc -2 +} + +set gitguidir [file dirname [info script]] +regsub -all ";" $gitguidir "\\;" gitguidir +set env(PATH) "$gitguidir;$env(PATH)" +unset gitguidir + +source [file join [file dirname [info script]] git-gui.tcl] -- cgit v1.2.1