Skip to content

Commit 097ea46

Browse files
committed
add docs; tag 0.0.1
1 parent 7ce86bf commit 097ea46

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "calcit_command"
33
version = "0.0.1"
4-
authors = ["jiyinyiyong <[email protected]>"]
4+
authors = ["tiye <[email protected]>"]
55
edition = "2021"
66

77
[lib]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
## Workflow
1+
## Respo Command
22

3-
> Rust library for Calcit runtime.
3+
> binds to `std::process:command`
44
5-
API 设计: https://github.com/calcit-lang/calcit_runner.rs/discussions/116 .
5+
API 设计: https://github.com/calcit-lang/calcit/discussions/116 .
66

77
### Usages
88

99
APIs:
1010

1111
```cirru
12-
lib.core/path-exists? a
12+
command.core/run-command cmd arg1 arg2
1313
```
1414

1515
Install to `~/.config/calcit/modules/`, compile and provide `*.{dylib,so}` file with `./build.sh`.

deps.cirru

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{}
2+
:calcit-version |0.9.9

src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
use cirru_edn::Edn;
2-
use std::path::Path;
32
use std::process::Command;
43

54
#[no_mangle]
65
pub fn abi_version() -> String {
76
String::from("0.0.9")
87
}
98

10-
#[no_mangle]
11-
pub fn path_exists(args: Vec<Edn>) -> Result<Edn, String> {
12-
if args.len() == 1 {
13-
if let Edn::Str(name) = &args[0] {
14-
Ok(Edn::Bool(Path::new(&**name).exists()))
15-
} else {
16-
Err(format!("path-exists? expected 1 filename, got {:?}", args))
17-
}
18-
} else {
19-
Err(format!("path-exists? expected 1 arg, got {:?}", args))
20-
}
21-
}
22-
239

2410
/// simple command to run a command, without options
2511
#[no_mangle]

0 commit comments

Comments
 (0)