]> git.ipfire.org Git - thirdparty/git.git/blob - git-gui/macosx/AppMain.tcl
Merge branch 'sr/gpg-interface-stop-at-the-end'
[thirdparty/git.git] / git-gui / macosx / AppMain.tcl
1 set gitexecdir {@@gitexecdir@@}
2 if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
3 set gitguilib $::env(GIT_GUI_LIB_DIR)
4 } else {
5 set gitguilib {@@GITGUI_LIBDIR@@}
6 }
7
8 set env(PATH) "$gitexecdir:$env(PATH)"
9
10 if {[string first -psn [lindex $argv 0]] == 0} {
11 lset argv 0 [file join $gitexecdir git-gui]
12 }
13
14 if {[file tail [lindex $argv 0]] eq {gitk}} {
15 set argv0 [lindex $argv 0]
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]
20 if {[info exists env(PWD)]} {
21 cd $env(PWD)
22 } elseif {[pwd] eq {/}} {
23 cd $env(HOME)
24 }
25 }
26
27 unset gitexecdir gitguilib
28 set argv [lrange $argv 1 end]
29 source $AppMain_source