Commits

guillermooo committed 5bf1669 Merge

Merge pull request #16 from TheMysteriousX/master

add push command for OS X

  • Participants
  • Parent commits c4c6de7, 3e14ce2
  • Tags s2-legacy

Comments (0)

Files changed (1)

File sublime_hg.py

 from shglib.parsing import CommandLexer
 
 
-VERSION = '12.8.11'
+VERSION = '12.8.12'
 
 
 CMD_LINE_SYNTAX = 'Packages/SublimeHg/Support/SublimeHg Command Line.hidden-tmLanguage'
             raise EnvironmentError("No terminal found."
                                    "You might want to add packages.sublime_hg.terminal "
                                    "to your settings.")
+    elif sublime.platform() == 'osx':
+        cmd_str = "%s %s" % (hg_bin, cmd)
+        osa = "tell application \"Terminal\"\ndo script \"cd '%s' && %s\"\nactivate\nend tell" % (os.getcwd(), cmd_str)
+
+        subprocess.Popen(["osascript", "-e", osa])
     else:
-        raise NotImplementedError("Cannot run consoles in OS X. Not implemented.")
+        raise NotImplementedError("Cannot run consoles on your OS: %s. Not implemented." % sublime.platform())
 
 
 def escape(s, c, esc='\\\\'):