[][src]Function sliderule::change_licenses

pub fn change_licenses(
    target_dir: &Path,
    source_license: String,
    doc_license: String
) -> SROutput

Allows the user to change the source and/or documentation licenses for the project.

target_dir must be a valid Sliderule component directory. source_license Must be an SPDX compliant string for the component's source files (mechanical/electrical CAD, etc) doc_license Must be an SPDX compliant string for the documentation content of the component

Examples


let output = sliderule::change_licenses(
   &test_dir.join("toplevel"),
   String::from("TestSourceLicense"),
   String::from("TestDocLicense"),
   );

assert_eq!(0, output.status);
assert!(output.stderr.is_empty());
let content = fs::read_to_string(test_dir.join("toplevel")
   .join(".sr"))
   .expect("Unable to read file");

assert!(content.contains("TestSourceLicense"));
assert!(content.contains("TestDocLicense"));