Created ide.write (markdown)

ni-richard 2019-09-12 10:45:01 +02:00
parent 87225a7eed
commit 6f5a2ababa

54
ide.write.md Normal file

@ -0,0 +1,54 @@
### Request
* **Description**: Overwrites the contents of a file.
* **Subscribers**: [IdeHandler](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/IdeHandler)
```json
{
"key": "ide.write",
"intent": "control",
"scope": "zmq"
}
```
| Parameter | Type | Required | Description |
| ------------ |:--------:|:------------------:| --------------------------- |
| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. |
| *content* | `string` | | New contents of the selected file. |
***
**Example**:
```json
{
"key": "ide.write",
"filename": "main.c",
"content": "#include <stdio.h>..."
}
```
### Response
* **Description**: Informs the frontend that the file was changed.
* **Subscribers**: *none*
```json
{
"key": "ide.write",
"scope": "websocket"
}
```
| Parameter | Type | Required | Description |
| ------------ |:--------:|:------------------:| --------------------------- |
| *filename* | `string` | :heavy_check_mark: | Full path or basename of a file. |
| *files* | `array` | :heavy_check_mark: | List of every readable file according to the current patterns. |
***
**Example**:
```json
{
"key": "ide.write",
"filename": "main.c",
"files": ["/home/main.c", "/home/not_main.c"]
}
```