Добавлено определение пути до git в зависимости от платформы.
This commit is contained in:
@@ -25,7 +25,7 @@ set ::configDefault "\[General\]
|
||||
cfgModifyDate=''
|
||||
searchCommand=/usr/bin/grep
|
||||
searchCommandOptions=-r -n -H
|
||||
gitCommand=/usr/bin/git
|
||||
gitCommand=
|
||||
# must return a mime type of file
|
||||
fileTypeCommand=/usr/bin/file
|
||||
fileTypeCommandOptions=-i -b
|
||||
|
||||
22
lib/git.tcl
22
lib/git.tcl
@@ -12,6 +12,28 @@
|
||||
namespace eval Git {
|
||||
variable gitCommand
|
||||
|
||||
# Определим путь до команды git в зависимсти от платформы
|
||||
proc CommandPathSetting {} {
|
||||
global cfgVariables tcl_platform
|
||||
if {$cfgVariables(gitCommand) == ""} {
|
||||
if {$tcl_platform(platform) eq "windows"} {
|
||||
set cmd {where git}
|
||||
} else {
|
||||
set cmd {which git}
|
||||
}
|
||||
if {[catch {exec {*}$cmd} git_path]} {
|
||||
puts "Git не найден в системе"
|
||||
set cfgVariables(gitCommand) "Git not found"
|
||||
return
|
||||
}
|
||||
set git_path [string trim $git_path]
|
||||
set first_path [lindex [split $git_path "\n"] 0]
|
||||
|
||||
# puts "Git найден: $first_path"
|
||||
set cfgVariables(gitCommand) $first_path
|
||||
}
|
||||
}
|
||||
|
||||
proc GetConfig {option} {
|
||||
global activeProject cfgVariables
|
||||
set confOptions {
|
||||
|
||||
@@ -112,6 +112,8 @@ puts "Setting the locale... [::msgcat::mclocale]"
|
||||
|
||||
source [file join $dir(lib) gui.tcl]
|
||||
|
||||
Git::CommandPathSetting
|
||||
|
||||
# Open the PATH if command line argument has been setting
|
||||
if [info exists opened] {
|
||||
foreach path $opened {
|
||||
@@ -147,3 +149,4 @@ if [info exists opened] {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user