Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the process/command API #83

Open
mattwparas opened this issue Sep 20, 2023 · 0 comments
Open

Document the process/command API #83

mattwparas opened this issue Sep 20, 2023 · 0 comments

Comments

@mattwparas
Copy link
Owner

mattwparas commented Sep 20, 2023

See here for the module

It is a little opaque - the functions that return Result return a struct to rust that is Ok or Err, which makes it non obvious how to use. On top of that, some of the functions are builders, and some act via mutation. First is to probably add some documentation to these functions, and then after that we should implement a module in the cogs directory that wraps up some of the more low level functions into something a bit more idiomatic.

For example, capturing std out into a string is a little non obvious:

(define (with-stdout-piped command)
  (set-piped-stdout! command)
  command)

(~> (command "git" (list "check-ignore" "target"))
    (with-stdout-piped)
    (spawn-process)
    (Ok->value)
    (wait->stdout)
    (Ok->value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant