Skip to main content

adjust_meta_key_path

Function adjust_meta_key_path 

Source
pub fn adjust_meta_key_path(meta_key: &str, relative_path: &str) -> String
Expand description

Adjust a meta key path by replacing "./" prefix with the relative path.

Meta keys are formatted as "instance_path/field_path". When an instance path starts with "./", this function replaces it with the actual relative path from the module root.

ยงExamples

use cuenv_core::cue::discovery::adjust_meta_key_path;

assert_eq!(adjust_meta_key_path("./tasks/build", "services/api"), "services/api/tasks/build");
assert_eq!(adjust_meta_key_path("other/path", "services/api"), "other/path");