From c86b78c01a7201bfa56dd150abc6cedc26247ffe Mon Sep 17 00:00:00 2001 From: Mikhail Gordeev Date: Thu, 16 Apr 2020 16:17:44 +0300 Subject: [PATCH] Add option for creating remote dirs --- cloud_build/cloud_build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloud_build/cloud_build.py b/cloud_build/cloud_build.py index 1597826..1f4f11e 100755 --- a/cloud_build/cloud_build.py +++ b/cloud_build/cloud_build.py @@ -25,6 +25,7 @@ class CB: def __init__(self, args: Any) -> None: self.parse_config(args.config) self.no_tests = getattr(args, 'no_tests', False) + self._create_remote_dirs = getattr(args, 'create_remote_dirs', False) data_dir = (Path(os.getenv('XDG_DATA_HOME', '~/.local/share')).expanduser() @@ -539,6 +540,8 @@ Dir::Etc::preferencesparts "/var/empty"; def sync(self) -> None: for branch in self.branches: remote = self.remote(branch) + if self._create_remote_dirs: + os.makedirs(remote, exist_ok=True) cmd = [ 'rsync', f'{self.images_dir}/{branch}/',