From 93568a5f2bc283817b6b80df0a1739b6ac02932b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 11 Aug 2009 15:43:20 +0200 Subject: [PATCH] Add a quiet config function The "config" function now complains loudly when something did not work, but the "config_quiet" function just returns the empty string in that case. Signed-off-by: Johannes Schindelin --- lilycontrib.tcl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lilycontrib.tcl b/lilycontrib.tcl index 2a92c27ccb..f35409df84 100755 --- a/lilycontrib.tcl +++ b/lilycontrib.tcl @@ -41,7 +41,19 @@ proc config {args} { global lily_dir set p [open [linsert $args 0 "|git" --git-dir=$lily_dir/.git config] r] set result [regsub "\n\$" [read $p] ""] - close $p + if {[catch {close $p} err]} { + tk_messageBox -type ok -message "config failed: $err" + } + return $result +} + +proc config_quiet {args} { + global lily_dir + set p [open [linsert $args 0 "|git" --git-dir=$lily_dir/.git config] r] + set result [regsub "\n\$" [read $p] ""] + if {[catch {close $p} err]} { + set result "" + } return $result } -- 2.11.4.GIT