aboutsummaryrefslogtreecommitdiffstats
path: root/SharedSupport/Default Bundles
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-14 16:25:50 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-14 16:25:50 +0000
commitc352ef02ae0e81496c9db2b8973a8cdd43669366 (patch)
tree9488c6ad37b5a228082095a20ac0809e391ef224 /SharedSupport/Default Bundles
parent1a824b893dbc02ad5ce962d4ec33aeff765bdb5f (diff)
downloadsequelpro-c352ef02ae0e81496c9db2b8973a8cdd43669366.tar.gz
sequelpro-c352ef02ae0e81496c9db2b8973a8cdd43669366.tar.bz2
sequelpro-c352ef02ae0e81496c9db2b8973a8cdd43669366.zip
• fixed issue for default Bundles if category or key equivalent was changed by the user
• improved Format SQL Bundle - added checking for empty passed SQL string - changed category to Format
Diffstat (limited to 'SharedSupport/Default Bundles')
-rw-r--r--SharedSupport/Default Bundles/Format SQL.spBundle/command.plist14
1 files changed, 11 insertions, 3 deletions
diff --git a/SharedSupport/Default Bundles/Format SQL.spBundle/command.plist b/SharedSupport/Default Bundles/Format SQL.spBundle/command.plist
index 219cc2c7..f6472de5 100644
--- a/SharedSupport/Default Bundles/Format SQL.spBundle/command.plist
+++ b/SharedSupport/Default Bundles/Format SQL.spBundle/command.plist
@@ -5,11 +5,19 @@
<key>author</key>
<string>Hans-Jörg Bibiko</string>
<key>category</key>
- <string>Query Editor</string>
+ <string>Format</string>
<key>command</key>
<string>
+
+# check for empty STDIN
+SQL=$(cat)
+if [ -z "$SQL" ]; then
+ echo "No SQL statements passed."
+ exit $SP_BUNDLE_EXIT_SHOW_AS_TEXT_TOOLTIP
+fi
+
# check if connected to the internet and if server is up
-connected=$(/sbin/ping -t 3 -c 1 -on www.dpriver.com 2&gt; /dev/null | grep 'icmp' | wc -l)
+connected=$(/sbin/ping -t 5 -c 1 -on www.dpriver.com 2&gt; /dev/null | grep 'icmp' | wc -l)
if [ $connected -eq "0" ]; then
echo "&lt;font color=red&gt;You are probably not connected to the internet or http://www.dpriver.com/ server is down.&lt;/font&gt;"
exit $SP_BUNDLE_EXIT_SHOW_AS_HTML_TOOLTIP
@@ -81,7 +89,7 @@ cat &lt;&lt;HTML
&lt;div id="sqlpanel"&gt;
&lt;div id="sp_inputsql"&gt;
&lt;textarea id ="inputsql" name="inputsql" cols="1" rows="1" wrap="off"&gt;
- `cat`
+ $SQL
&lt;/textarea&gt;
&lt;/div&gt;
&lt;div id="sp_submit"&gt;