From 0add10c6a40bb27feb90c7faaa8beb155d448cd9 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sat, 17 Jan 2009 15:07:08 +0000 Subject: [PATCH] added install command, also now saves class/ref opening settings when SC closes --- .../Commands/Install.tmCommand | 52 +++++++++++++++++++ .../README.html | 0 .../README.textile | 0 .../Support/classes/TextMate.sc | 24 ++++++++- 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 SuperCollider.tmbundle/Commands/Install.tmCommand rename README.html => SuperCollider.tmbundle/README.html (100%) rename README.textile => SuperCollider.tmbundle/README.textile (100%) rename TextMate.sc => SuperCollider.tmbundle/Support/classes/TextMate.sc (89%) diff --git a/SuperCollider.tmbundle/Commands/Install.tmCommand b/SuperCollider.tmbundle/Commands/Install.tmCommand new file mode 100644 index 0000000..02157ed --- /dev/null +++ b/SuperCollider.tmbundle/Commands/Install.tmCommand @@ -0,0 +1,52 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +def could_not_locate + puts "<span style='color:red'>There was a problem</span><br/>" + puts "Probably, you do not have SuperCollider installed, or you are using a non-standard user support directory.<br/><br/>" + puts "You will need to manually copy <code>supercollider-tmbundle/Support/classes/TextMate.sc</code> into your SC class path" +end + +puts "=======================================<br/>" +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/>" +else + if not File.directory?(File.expand_path("~/Library/Application Support/SuperCollider/Extensions")) + could_not_locate + 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 + end +end + + fallbackInput + document + input + selection + keyEquivalent + $@ + name + Install + output + showAsHTML + scope + source.supercollider + uuid + BB37ACE9-8262-4AF6-B3C6-43DC0AF2B370 + + diff --git a/README.html b/SuperCollider.tmbundle/README.html similarity index 100% rename from README.html rename to SuperCollider.tmbundle/README.html diff --git a/README.textile b/SuperCollider.tmbundle/README.textile similarity index 100% rename from README.textile rename to SuperCollider.tmbundle/README.textile diff --git a/TextMate.sc b/SuperCollider.tmbundle/Support/classes/TextMate.sc similarity index 89% rename from TextMate.sc rename to SuperCollider.tmbundle/Support/classes/TextMate.sc index b7d7c8e..0a9a909 100755 --- a/TextMate.sc +++ b/SuperCollider.tmbundle/Support/classes/TextMate.sc @@ -1,8 +1,17 @@ TextMate { classvar menu,