Skip to content

Warn if the working dir is exists but empty (on init) #75

@wonder-sk

Description

@wonder-sk

If the working dir has been created (but there's nothing in it), the init will fail when trying to get version of the mergin project. It would be useful to first do a check if there's a project there...

== Starting Mergin DB Sync version 1.0.6 ==
Logging in to Mergin...
Initializing from an existing GeoPackage...
Connecting to the database...
Traceback (most recent call last):
  File "dbsync.py", line 733, in <module>
    main()
  File "dbsync.py", line 714, in main
    dbsync_init(mc, True)
  File "dbsync.py", line 548, in dbsync_init
    local_version = _get_project_version()
  File "dbsync.py", line 242, in _get_project_version
    return mp.metadata["version"]
  File "/home/adriaan/.local/lib/python3.8/site-packages/mergin/merginproject.py", line 137, in metadata
    raise InvalidProject('Project metadata has not been created yet')
mergin.common.InvalidProject: Project metadata has not been created yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions