Skip to content

Commit 6e68f94

Browse files
committed
create_project_and_push: check that the dir is not associated yet
1 parent 0b724e5 commit 6e68f94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mergin/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ def create_project_and_push(self, project_name, directory, is_public=False, name
339339
"""
340340
Convenience method to create project and push the initial version right after that.
341341
"""
342+
if os.path.exists(os.path.join(directory, '.mergin')):
343+
raise ClientError('Directory is already assigned to a Mergin project (contains .mergin sub-dir)')
344+
342345
if namespace is None:
343346
namespace = self.username()
344347
self.create_project(project_name, is_public, namespace)

0 commit comments

Comments
 (0)