MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / overwrite_check

Function overwrite_check

splashsurf/src/convert.rs:141–150  ·  view source on GitHub ↗

Returns an error if the file already exists but overwrite is disabled

(cmd_args: &ConvertSubcommandArgs)

Source from the content-addressed store, hash-verified

139
140/// Returns an error if the file already exists but overwrite is disabled
141fn overwrite_check(cmd_args: &ConvertSubcommandArgs) -> Result<(), anyhow::Error> {
142 if !cmd_args.overwrite && cmd_args.output_file.exists() {
143 return Err(anyhow!(
144 "Aborting: Output file \"{}\" already exists. Use overwrite flag to ignore this.",
145 cmd_args.output_file.display()
146 ));
147 }
148
149 Ok(())
150}

Callers 1

convert_subcommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected