From 431bfd50f99a4d7b2195102520c4482d3da3e834 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sun, 18 Jan 2009 03:08:37 +0000 Subject: [PATCH] fix installation so that class is always reinstalled, even if already exists --- Commands/Install.tmCommand | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Commands/Install.tmCommand b/Commands/Install.tmCommand index 02157ed..5adad12 100644 --- a/Commands/Install.tmCommand +++ b/Commands/Install.tmCommand @@ -18,21 +18,24 @@ puts "Textmate SuperCollider bundle<br/>" puts "by <a href='http://rfwatson.github.com'>R.Watson</a>.<br/>" puts "=======================================<br/><br/>" -if File.exists?(File.expand_path("~/Library/Application Support/SuperCollider/Extensions/TextMate.sc")) - puts "<span style='color:green'>SuperCollider bundle already installed</span>.<br/>" +fname = File.expand_path("~/Library/Application Support/SuperCollider/Extensions/TextMate.sc") +if File.exists?(fname) + #puts "<span style='color:green'>SuperCollider bundle already installed</span>.<br/>" + File.rename(fname, fname + '.bak') +end + +if not File.directory?(File.expand_path("~/Library/Application Support/SuperCollider/Extensions")) + could_not_locate else - if not File.directory?(File.expand_path("~/Library/Application Support/SuperCollider/Extensions")) - could_not_locate + if system %Q{ln -s '#{ENV['TM_BUNDLE_SUPPORT']}/classes/TextMate.sc' '#{File.expand_path("~/Library/Application Support/SuperCollider/Extensions/TextMate.sc")}'} + puts "<span style='color:green'>Successfully installed TextMate class</span>.<br/><br/>" + puts "Relaunch SuperCollider to complete installation." else - if system %Q{ln -s '#{ENV['TM_BUNDLE_SUPPORT']}/classes/TextMate.sc' '#{File.expand_path("~/Library/Application Support/SuperCollider/Extensions/TextMate.sc")}'} - puts "<span style='color:green'>Successfully installed TextMate class</span>.<br/><br/>" - puts "Relaunch SuperCollider to complete installation." - else - puts "There was an error installing the class file.<br/><br/>" - could_not_locate - end + puts "There was an error installing the class file.<br/><br/>" + could_not_locate end end + fallbackInput document