https://github.com/replit/toml-editor
https://github.com/replit/toml-editor
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/replit/toml-editor
- Owner: replit
- Created: 2022-06-15T18:31:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T02:01:58.000Z (about 1 year ago)
- Last Synced: 2025-03-24T15:52:18.007Z (11 months ago)
- Language: Rust
- Size: 157 KB
- Stars: 9
- Watchers: 28
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toml Editor
This is the toml editor which is used by the dotreplit service to update the .replit file while preserving formatting (e.g. line spacing and comments).
To run a dev build, just run `cargo run`. For a production build, run `cargo build --release`.
More info about this [here](https://replit.com/@util/Design-docs#goval/dotreplit_editor.md)
Once this is running, it reads json input from stdin and returns output through stdout.
The json it reads in is in the format of https://datatracker.ietf.org/doc/html/rfc6902 with one slight difference. The value field is a stringified json instead of the actual json value.
Below is an example set of operations:
(note - these examples will have spacing and formatting to make it easier to read but when testing, this should all be removed).
```
[
{ "op": "add", "path": "foo", "value": 123 },
{ "op": "add", "path": "bar/1", "value": "{\"test\": 234}"}
]
```
You can include the file path of the .replit file like so `./toml-editor -p `. If you do not, it will default to looking in the current directory for the `.replit` file.