summaryrefslogtreecommitdiff
path: root/lib/shortcut.tcl
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-05 22:39:40 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-06 08:02:18 (GMT)
commit47282d4646372aa859908c3b9471b96c385abe5f (patch)
tree4a9fa44723364a45b6cb3eea659b5366acaad913 /lib/shortcut.tcl
parent87b49a533b0ee0da06c06fb466844885ae0d35bd (diff)
downloadgit-47282d4646372aa859908c3b9471b96c385abe5f.zip
git-47282d4646372aa859908c3b9471b96c385abe5f.tar.gz
git-47282d4646372aa859908c3b9471b96c385abe5f.tar.bz2
git-gui: Ensure windows shortcuts always have .bat extension
Apparently under some setups on Windows Tk is hiding our file extension recommendation of ".bat" from the user and that is allowing the user to create a shortcut file which has no file extension. Double clicking on such a file in Windows Explorer brings up the associate file dialog, as Windows does not know what application to launch. We now append the file extension ".bat" to the filename of the shortcut file if it has no extension or if it has one but it is not ".bat". Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/shortcut.tcl')
-rw-r--r--lib/shortcut.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl
index ebf72e4..a0a1b7d 100644
--- a/lib/shortcut.tcl
+++ b/lib/shortcut.tcl
@@ -9,6 +9,9 @@ proc do_windows_shortcut {} {
-title "[appname] ([reponame]): Create Desktop Icon" \
-initialfile "Git [reponame].bat"]
if {$fn != {}} {
+ if {[file extension $fn] ne {.bat}} {
+ set fn ${fn}.bat
+ }
if {[catch {
set fd [open $fn w]
puts $fd "@ECHO Entering [reponame]"
@@ -42,6 +45,9 @@ proc do_cygwin_shortcut {} {
-initialdir $desktop \
-initialfile "Git [reponame].bat"]
if {$fn != {}} {
+ if {[file extension $fn] ne {.bat}} {
+ set fn ${fn}.bat
+ }
if {[catch {
set fd [open $fn w]
set sh [exec cygpath \