Skip to main content

save

Function save 

Source
pub fn save(
    location: SaveLocation,
    cwd: &Path,
    name: &str,
    source: &str,
    overwrite: bool,
) -> Result<PathBuf>
Expand description

Write a workflow script, refusing to follow a symbolic link.

Writing through a link would put the file somewhere the user did not choose, so each part of the path is checked first. The write goes through a temporary file in the same directory and is then renamed, so an interrupted save cannot leave a truncated script behind.