git-gui: allow Ctrl+T to toggle multiple paths
[git/git.git] / macosx / AppMain.tcl
CommitLineData
72a8e81d 1set gitexecdir {@@gitexecdir@@}
a3b3ae35
DT
2if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
3 set gitguilib $::env(GIT_GUI_LIB_DIR)
4} else {
5 set gitguilib {@@GITGUI_LIBDIR@@}
6}
7
72a8e81d
SP
8set env(PATH) "$gitexecdir:$env(PATH)"
9
10if {[string first -psn [lindex $argv 0]] == 0} {
11 lset argv 0 [file join $gitexecdir git-gui]
12}
13
14if {[file tail [lindex $argv 0]] eq {gitk}} {
7838d3fb 15 set argv0 [lindex $argv 0]
72a8e81d
SP
16 set AppMain_source $argv0
17} else {
18 set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]]
19 set AppMain_source [file join $gitguilib git-gui.tcl]
446f8226
MK
20 if {[info exists env(PWD)]} {
21 cd $env(PWD)
22 } elseif {[pwd] eq {/}} {
72a8e81d
SP
23 cd $env(HOME)
24 }
25}
26
27unset gitexecdir gitguilib
28set argv [lrange $argv 1 end]
29source $AppMain_source