Fixed init_directory_structure for destination on local FS
Change-Id: I9e7312a73eb68974fb5ad6b4912fa3c308a1c37d
diff --git a/trsync.py b/trsync.py
index 0a44f5d..d9e6923 100644
--- a/trsync.py
+++ b/trsync.py
@@ -32,11 +32,15 @@
self.init_directory_structure()
def init_directory_structure(self):
+ dir_full_name = self.url.a_dir(self.url.path, self.snapshot_dir)
if self.url.url_type != 'path':
server_root = RsyncRemote(self.url.root)
- return server_root.mkdir(
- self.url.a_dir(self.url.path, self.snapshot_dir)
- )
+ return server_root.mkdir(dir_full_name)
+ else:
+ if not os.path.isdir(dir_full_name):
+ return os.makedirs(dir_full_name)
+ return True
+
def push(self, source, repo_name, symlinks=[], extra=None, save_diff=True):
repo_basename = os.path.split(repo_name)[-1]