foxtrot icon indicating copy to clipboard operation
foxtrot copied to clipboard

Built target only works when the current directory is the Foxtrot directory - hard-coded specific file names

Open DerekK19 opened this issue 1 year ago • 0 comments

The two gui files model.rs and backdrop.rs have hard-coded file names in std::fs::read calls. This means that the gui target will only run when the current directory is Foxtrot.

A simple change (from someone who has never programmed in Rust until today!) is to change the line in gui/src/backdrop.rs

std::fs::read("gui/src/backdrop.wgsl")

to

std::fs::read(concat!(env!("CARGO_MANIFEST_DIR"), "/src/backdrop.wgsl"))

and similar in model.rs

Once this is done, the gui target can be executed from any folder - e.g the one where the step files are

DerekK19 avatar Dec 02 '24 02:12 DerekK19