MCPcopy Create free account
hub / github.com/PerroEngine/Perro / build_web_command

Function build_web_command

perro_source/devtools/perro_cli/src/project.rs:808–835  ·  view source on GitHub ↗
(args: &[String], cwd: &Path)

Source from the content-addressed store, hash-verified

806fn count_braces_outside_strings(line: &str) -> (usize, usize) {
807 let mut escaped = false;
808 let mut in_string = false;
809 let mut open = 0usize;
810 let mut close = 0usize;
811 for ch in line.chars() {
812 if escaped {
813 escaped = false;
814 continue;
815 }
816 match ch {
817 '\\' if in_string => escaped = true,
818 '"' => in_string = !in_string,
819 '{' if !in_string => open += 1,
820 '}' if !in_string => close += 1,
821 _ => {}
822 }
823 }
824 (open, close)
825}
826
827fn indent(out: &mut String, depth: usize) {
828 for _ in 0..depth {
829 out.push_str(" ");
830 }
831}
832
833pub(crate) fn project_command(args: &[String], cwd: &Path) -> Result<(), String> {
834 let target = parse_cli_target(args)?;
835 let native_target = parse_flag_value(args, "--triple");
836 let universal_macos = args.iter().any(|a| a == "--universal-macos");
837 if (native_target.is_some() || universal_macos) && target != CliTarget::Native {
838 return Err("`--triple` + `--universal-macos` only support `--target native`".to_string());

Callers 1

project_commandFunction · 0.85

Calls 12

log_stepFunction · 0.85
compile_project_bundleFunction · 0.85
log_doneFunction · 0.85
anyMethod · 0.80
with_web_output_dirMethod · 0.80
with_targetMethod · 0.80
parse_flag_valueFunction · 0.70
resolve_local_pathFunction · 0.70
workspace_rootFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected