diff --git a/docs/commands/push.md b/docs/commands/push.md index f7e549d..c2be6c3 100644 --- a/docs/commands/push.md +++ b/docs/commands/push.md @@ -1,32 +1,14 @@ ## Push -```mermaid -flowchart TD - A[Start] --> G[Get staged objects] - G --> GNO[Get next object] - GNO --> H{Object empty ?} - H --> |No| B{Is a directory ?} - H ----> |Yes| F[End] - B --> |Yes| C[Push Folder] - B --> |No| E[Push File] - C --> GNO - E --> GNO -``` - -## Pushing a folder - -```mermaid -flowchart TD - A[Start] --> B{Is local folder older than the server one ?} - - -``` - - -## Pushing a file - -```mermaid - - -``` \ No newline at end of file +1. Get list of file and folder to push from ``.nextsync/index`` +2. For each object in the list: + * If it is a file: + * Check if the file exists on the server + * If a collision occurs, compare the modification date (given by the file blob and the server) + * If it is more recent download the file under with ``.dist`` extension + * Else overwrite the file + * If not collision occurs, upload the file + * If is it a folder: + * If the folder exists on the server apply this procedure for its content + * Else upload it \ No newline at end of file