Skip to content

Commit 083c76d

Browse files
committed
fix to download empty initialized project
1 parent 2c71785 commit 083c76d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def status():
127127
return
128128

129129
click.echo("Current version: {}".format(project_info["version"]))
130-
last_version = versions[-1]
131130
new_versions = [v for v in versions if num_version(v["name"]) > local_version]
132131
if new_versions:
133132
click.secho("### Available updates: {}".format(len(new_versions)), fg="magenta")

mergin/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,14 @@ def download_project(self, project_path, directory):
356356
os.makedirs(directory)
357357

358358
project_info = self.project_info(project_path)
359+
version = project_info['version'] if len(project_info['version']) else 'v0'
359360

360361
for file in project_info['files']:
361-
self._download_file(project_path, project_info['version'], file, directory)
362+
self._download_file(project_path, version, file, directory)
362363

363364
data = {
364365
"name": project_path,
365-
"version": project_info["version"],
366+
"version": version,
366367
"files": project_info["files"]
367368
}
368369
save_project_file(directory, data)
@@ -467,7 +468,7 @@ def backup_if_conflict(path, checksum):
467468
move_file(local_path(file["path"]), local_path(file["new_path"]))
468469

469470
local_info["files"] = server_info["files"]
470-
local_info["version"] = server_info["version"]
471+
local_info["version"] = server_info["version"] if len(server_info["version"]) else 'v0'
471472
save_project_file(directory, local_info)
472473

473474
def _download_file(self, project_path, project_version, file, directory):

0 commit comments

Comments
 (0)