[][src]Function sliderule::refactor

pub fn refactor(
    target_dir: &Path,
    name: String,
    url: String,
    username: Option<String>,
    password: Option<String>
) -> SROutput

Converts a local component into a remote component, uploading it to the remote repo and then installing via npm.

target_dir must be a valid Sliderule component directory. name is the name of the component in the components directory to refactor. url is the remote URL to push the component to. This URL must exist before this is called.

Examples

let temp_dir = std::env::temp_dir();

let output = sliderule::refactor(
    &temp_dir.join("newproject"),
    String::from("level1_component"),
    String::from("https://repo.com/user/level1_component"),
    None,
    None
);