[−][src]Function sliderule::add_remote_component
pub fn add_remote_component(
target_dir: &Path,
url: &str,
cache: Option<String>
) -> SROutput
Adds a component from the remote repository at the provided URL to the node_modules directory.
target_dir
must be a valid Sliderule component directory.
url
URL of the repository the remote component resides in.
'cache` Allows a user to specify a temporary cache for npm to use. Mostly for testing purposes.
Examples
let output = sliderule::add_remote_component( &test_dir.join("toplevel"), "https://github.com/jmwright/arduino-sr.git", Some(cache_dir.to_string_lossy().to_string()), ); assert_eq!(0, output.status); let component_path = test_dir .join("toplevel") .join("node_modules") .join("arduino-sr"); assert!(component_path.exists());