Created
November 12, 2016 15:48
-
-
Save yovchev/d561ca3a93f5fc66349778932d099fde to your computer and use it in GitHub Desktop.
CMD Sublime Text 3 Package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""CMD Sublime Text 3 Package. | |
Open `cmd` from the curent locaion of the file. | |
Installation: Preferences -> Browser Packages, Create folder `CMD` and inside | |
copy the files from this Gist | |
""" | |
import os | |
import sublime_plugin | |
class CmdCommand(sublime_plugin.TextCommand): | |
"""Register the command with sublime plugin syste,.""" | |
def run(self, edit): | |
"""When the user clicks on the command.""" | |
file_name = self.view.file_name() | |
path = file_name.split("\\") | |
current_driver = path[0] | |
path.pop() | |
current_directory = "\\".join(path) | |
command = "cd " + current_directory + " & " + current_driver + " & start cmd" | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment