2024-10-15 10:50:56 +03:00
|
|
|
---
|
2024-09-24 11:38:18 +03:00
|
|
|
sidebar_position: 5
|
|
|
|
---
|
|
|
|
|
2024-10-15 10:50:56 +03:00
|
|
|
import Tabs from '@theme/Tabs';
|
|
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
|
2024-09-24 11:38:18 +03:00
|
|
|
# Synchronize folders
|
|
|
|
Creates a copy of the local directory at the selected path on the Neocities server
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`Function SynchronizeFolders(Val Token, Val LocalFolder, Val RemoteFolder = "") Export`
|
|
|
|
|
2024-10-15 15:15:47 +03:00
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|
|
|-|-|-|-|-|
|
|
|
|
| Token | --token | String | ✔ | Auth token |
|
|
|
|
| LocalFolder | --local | String | ✔ | Local source catalog |
|
|
|
|
| RemoteFolder | --remote | String | ✖ | Remote receiver catalog. Root by default |
|
2024-09-24 11:38:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
Returns: Structure of KeyAndValue - synchronization error information
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
:::tip
|
|
|
|
Neocities API docs: [neocities.org/api](https://neocities.org/api)
|
|
|
|
|
|
|
|
The method deletes files on the server if they do not exist in the local directory
|
|
|
|
:::
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-10-15 21:15:56 +03:00
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
2024-09-24 11:38:18 +03:00
|
|
|
Token = "7419cd51de4037f7...";
|
|
|
|
|
|
|
|
LocalFolder = "C:\test_site";
|
2024-09-25 20:45:54 +03:00
|
|
|
RemoteFolder = "test_sync";
|
2024-09-24 11:38:18 +03:00
|
|
|
|
|
|
|
Result = OPI_Neocities.SynchronizeFolders(Token, LocalFolder, RemoteFolder);
|
|
|
|
```
|
2024-10-15 09:53:37 +03:00
|
|
|
|
2024-09-24 11:38:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-09-24 15:43:51 +03:00
|
|
|
{
|
|
|
|
"errors": 0,
|
|
|
|
"items": []
|
|
|
|
}
|
2024-09-24 11:38:18 +03:00
|
|
|
```
|