mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 10:58:04 +08:00
Replace npm build script with new cargo run tool (#3832)
* move nix flake to root * cargo run tool * use thiserror in third-party-licenses tool * prefere panic over exit * Add automatic dependency check to cargo run tool * Skip dependecies that are not needed for the current task * Fixup * Fixup * fix windows * Fixup * improve usage text * Fix linux bundle * add graphen-cli * fix build profile * fix * release profile should not include debug infos * Review * remove profiling profile was redundent with release * rename to cargo-run tool * improve consistency * rename deps to requirements * fix * return success when showing usage
This commit is contained in:
@@ -22,9 +22,11 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||
let app_dir = bundle(&profile_path, &app_bin, &helper_bin);
|
||||
|
||||
// TODO: Consider adding more useful cli
|
||||
if std::env::args().any(|a| a == "open") {
|
||||
let executable_path = app_dir.join(EXEC_PATH).join(APP_NAME);
|
||||
run_command(&executable_path.to_string_lossy(), &[]).expect("failed to open app");
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
if let Some(pos) = args.iter().position(|a| a == "open") {
|
||||
let executable = app_dir.join(EXEC_PATH).join(APP_NAME);
|
||||
let extra_args: Vec<&str> = args[pos + 1..].iter().map(|s| s.as_str()).collect();
|
||||
run_command(&executable.to_string_lossy(), &extra_args).expect("failed to open app");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user