Last active
December 19, 2015 12:59
-
-
Save mduvall/5958673 to your computer and use it in GitHub Desktop.
Ghetto SCP on sublime using subprocess
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
import sublime, sublime_plugin | |
import os | |
import tempfile | |
import subprocess | |
class SCPOnSave(sublime_plugin.EventListener): | |
def on_post_save(self, view): | |
folder_name, file_name = os.path.split(view.file_name()) | |
file_path = folder_name + '/' + file_name | |
command = 'scp ' + file_path + ' <URL HERE>:' + file_path + ' > /dev/null' | |
# view.window().run_command API on SL3 is undocumented for args | |
# show_output looks like it's deprecated and gone...using subprocess here | |
# so that panel won't open. | |
subprocess.call(command, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment