From b627f31a6e2ad8e2933926ed1ced8de5e36a4521 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 11 Aug 2009 18:29:21 +0200 Subject: [PATCH] Avoid two issues with a fresh clone The recent changes broke the script when lilypond was not yet cloned. Noticed by Maximilian Albert. Signed-off-by: Johannes Schindelin --- lilycontrib.tcl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lilycontrib.tcl b/lilycontrib.tcl index 7544c34e6a..f9d3b9ad91 100755 --- a/lilycontrib.tcl +++ b/lilycontrib.tcl @@ -5,7 +5,9 @@ package require Tk # Helper functions set lily_dir $env(HOME)/lilypond -cd $lily_dir +if {[file exists $lily_dir]} { + cd $lily_dir +} proc write_to_output {s} { .output.text insert insert $s @@ -27,7 +29,6 @@ proc write_file_to_output {f} { proc git {args} { global lily_dir git_command - file mkdir $lily_dir set git_command [linsert $args 0 "|git" "--git-dir=$lily_dir/.git"] set git_command "$git_command 2>@1" #.output.text insert end "$git_command\n" @@ -63,6 +64,7 @@ proc update_lilypond {} { if {![file exists $lily_dir]} { write_to_output "Cloning LilyPond (this can take some time) ...\n" file mkdir $lily_dir + cd $lily_dir git init git config core.bare false git remote add -t master \ @@ -71,7 +73,7 @@ proc update_lilypond {} { git reset --hard origin/master git config branch.master.remote origin git config branch.master.merge refs/heads/master - .update configure -text "Update LilyPond" + .buttons.update configure -text "Update LilyPond" } else { global rebase write_to_output "Updating LilyPond...\n" @@ -101,7 +103,7 @@ panedwindow .buttons button .buttons.update -text "Update LilyPond" -command update_lilypond label .buttons.rebase_label -text "Rebase" if {![file exists $lily_dir]} { - .update configure -text "Clone LilyPond" + .buttons.update configure -text "Clone LilyPond" } set rebase 0 if {[config_quiet --bool branch.master.rebase] == true} { -- 2.11.4.GIT