Browse files

Show tool tip when Build Target… can’t find any phony targets

Closes #4.
  • Loading branch information...
1 parent 9f10c2c commit 6c4bfa5cd39c17050503e79cae60dd21f208d0a6 @sorbits sorbits committed Mar 8, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 Commands/Build Target….tmCommand
View
1 Commands/Build Target….tmCommand
@@ -15,6 +15,7 @@ require ENV["TM_SUPPORT_PATH"] + "/lib/ui"
require ENV["TM_SUPPORT_PATH"] + "/lib/exit_codes"
targets = `#{TM_MAKE} -f#{TM_MAKE_FILE} -np|grep -B1 PHONY|grep -Ev '^(#|--|\\.)'|grep -Eo '^[^:]+'|sort -fu`.split.collect{|t| {"title" => t} }
+TextMate::exit_show_tool_tip "No root targets found in ‘#{TM_MAKE_FILE}’.\n\nOnly targets declarated as “phony”\nare considered to be root targets." if targets.empty?
selection = TextMate::UI.menu(targets)
TextMate::exit_discard if selection == nil

0 comments on commit 6c4bfa5

Please sign in to comment.