Add file and git operations accessible from Clojure code
This commit is contained in:
@@ -142,6 +142,26 @@ REPL чете по един JSON обект на ред и отговаря с
|
||||
- `message` — Четимо съобщение
|
||||
- `meta` — Както при успех
|
||||
|
||||
## Файлови Операции (от Clojure код)
|
||||
|
||||
| Функция | Пример | Връща |
|
||||
|---|---|---|
|
||||
| `file/read` | `(file/read "path")` | Низ със съдържание или map с грешка |
|
||||
| `file/write` | `(file/write "path" "content")` | `true` или map с грешка |
|
||||
| `file/append` | `(file/append "path" "more")` | `true` или map с грешка |
|
||||
| `file/ls` | `(file/ls "dir")` | Вектор с имена на файлове |
|
||||
| `file/exists?` | `(file/exists? "path")` | `true` / `false` |
|
||||
|
||||
## Git Операции (от Clojure код)
|
||||
|
||||
| Функция | Пример | Връща |
|
||||
|---|---|---|
|
||||
| `git/status` | `(git/status)` | Map с `:branch`, `:modified`, `:untracked`, `:staged`, `:clean` |
|
||||
| `git/commit` | `(git/commit "msg")` | Map с `:sha`, `:success` |
|
||||
| `git/push` | `(git/push)` | Map с `:success`, `:output` |
|
||||
| `git/diff` | `(git/diff)` | Низ с diff |
|
||||
| `git/log` | `(git/log)` или `(git/log 10)` | Вектор с commit низове |
|
||||
|
||||
## Команди в Човешки REPL
|
||||
|
||||
В човешки режим (`cljnim repl`):
|
||||
|
||||
Reference in New Issue
Block a user