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
|
|
|
|
|
|
|
|
2024-12-29 17:57:09 +03:00
|
|
|
Returns: Structure Of KeyAndValue - synchronization error information
|
2024-09-24 11:38:18 +03:00
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
:::tip
|
2024-11-21 13:27:18 +03:00
|
|
|
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
|
2024-09-24 11:38:18 +03:00
|
|
|
:::
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-12-16 19:38:57 +03:00
|
|
|
|
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
|
|
|
|
2024-10-20 22:36:03 +03:00
|
|
|
<Tabs>
|
|
|
|
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
|
|
```bash
|
|
|
|
oint neocities SynchronizeFolders \
|
2024-10-22 08:59:24 +03:00
|
|
|
--token "***" \
|
|
|
|
--local "C:\test_site" \
|
|
|
|
--remote "test_sync"
|
2024-10-20 22:36:03 +03:00
|
|
|
```
|
|
|
|
</TabItem>
|
|
|
|
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
|
|
```batch
|
|
|
|
oint neocities SynchronizeFolders ^
|
2024-10-22 08:59:24 +03:00
|
|
|
--token "***" ^
|
|
|
|
--local "C:\test_site" ^
|
|
|
|
--remote "test_sync"
|
2024-10-20 22:36:03 +03:00
|
|
|
```
|
|
|
|
</TabItem>
|
|
|
|
</Tabs>
|
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
|
|
|
```
|