1
0
mirror of https://github.com/git/git.git synced 2024-10-01 00:12:47 +02:00
git/windows/git-gui.sh
Steffen Prohaska 99fe594d96 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 <dir>' and changes to <dir> 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 <prohaska@zib.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-10 03:50:01 -04:00

17 lines
404 B
Bash

#!/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]