mirror of
https://github.com/git/git.git
synced 2024-11-18 06:13:55 +01:00
99fe594d96
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>
17 lines
404 B
Bash
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]
|