purton-tech / rust-on-nails

Full stack web architecture for Rust
https://rust-on-nails.com
MIT License
366 stars 33 forks source link

New Cornucopia Version missing generate function. #18

Closed crovax124 closed 1 year ago

crovax124 commented 1 year ago

since im pretty new to this kind of Programming and Rust, i cannot figure out how to implement new cornucopia generate implementation

in the build.rs file

let output = std::process::Command::new("cornucopia") .arg("generate") .arg("-d") .arg(file_path) .arg("live") .arg("--url") .arg(db_url) .output()?;

doesnt work anymore since the cli of cornucopia doesnt have a generate argument anymore.

Somehow it should be converted to: https://github.com/cornucopia-rs/cornucopia/blob/main/examples/auto_build/_build.rs

9876691 commented 1 year ago
  // Call cornucopia. Use whatever CLI command you need.
  let output = std::process::Command::new("cornucopia")
      .arg("-q")
      .arg(queries_path)
      .arg("-d")
      .arg(&file_path)
      .arg("live")
      .arg(db_url)
      .output()
      .unwrap();

It should loom something like the above

9876691 commented 1 year ago

The documentation has now been updated. Thanks.