Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first shot at rsync

  • Loading branch information...
commit 64cf76d9f2bf38a9d5f677a1f6efc4967e0640b3 1 parent add1188
@jpb0104 authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 DevRsync.py
View
25 DevRsync.py
@@ -0,0 +1,25 @@
+import sublime, sublime_plugin, json, os
+
+class DevRsyncCommand(sublime_plugin.EventListener):
+ def on_post_save(self, view):
+ cmd = "rsync"
+ projectFolder = view.window().folders()[0]
+ projectFile = projectFolder + '/dev_rsync.json'
+
+ if os.path.exists(projectFile):
+ json_data = open(projectFile)
+ data = json.load(json_data)
+ json_data.close
+ sublime.error_message('hi')
+ return
+ for option in data['option']:
+ cmd += ' --' + option
+
+ for exclude in data['exclude']:
+ cmd += ' --exclude="' + exclude + '"'
+
+ cmd += ' ' + projectFolder + '/' + ' ' + data['host'] + ':' + data['target_dir'] + '/' + ' &'
+
+ print cmd
+
+ os.system(cmd)
Please sign in to comment.
Something went wrong with that request. Please try again.