diff --git a/src/reskit/cli/evaluator.rs b/src/reskit/cli/evaluator.rs index 97693e6..2458394 100644 --- a/src/reskit/cli/evaluator.rs +++ b/src/reskit/cli/evaluator.rs @@ -20,13 +20,14 @@ pub fn run_command() -> Result<(), Box> { TileOrder::Sprite => "sprite" } ), - Tools::Soundtrack { input_files, output_directory, input_format: _, output_format: _, source_file_format: _, artifact_output_directory } => { + Tools::Soundtrack { input_files, output_directory, input_format: _, output_format: _, source_file_format: _, source_file_output_directory, artifact_output_directory } => { if input_files.is_empty() { return Err( "no input files (see `reskit soundtrack --help` for more info)" )?; } let output_directory = if output_directory.ends_with( "/" ) { output_directory.to_string() } else { format!( "{}/", output_directory ) }; let artifact_output_directory = if artifact_output_directory.ends_with( "/" ) { artifact_output_directory.to_string() } else { format!( "{}/", artifact_output_directory ) }; + let source_file_output_directory = if source_file_output_directory.ends_with( "/" ) { source_file_output_directory.to_string() } else { format!( "{}/", source_file_output_directory ) }; let modules: Vec = input_files.iter().map( | filename | Ok( DmfModule::from_file( &filename )? ) ).collect::, Box>>()?; @@ -58,9 +59,11 @@ pub fn run_command() -> Result<(), Box> { // Output the shared artifacts used by all ESF sequences println!( "Writing sequence artifacts..." ); let shared_artifacts = combined_asset_list.to_bytes()?; - println!( "Writing sequence artifact {}", format!( "{}music.asm", artifact_output_directory ) ); - let mut file = File::create( format!( "{}music.asm", artifact_output_directory ) )?; + println!( "Writing sequence artifact {}", format!( "{}music.asm", source_file_output_directory ) ); + let mut file = File::create( format!( "{}music.asm", source_file_output_directory ) )?; file.write_all( &shared_artifacts )?; + + print_good( "all files converted successfully" ); } }; diff --git a/src/reskit/cli/settings.rs b/src/reskit/cli/settings.rs index 49d688d..7b5819d 100644 --- a/src/reskit/cli/settings.rs +++ b/src/reskit/cli/settings.rs @@ -84,6 +84,10 @@ pub enum Tools { #[arg(long, value_enum, default_value_t=ArtifactListFormat::Asmx)] source_file_format: ArtifactListFormat, + /// Output directory for the source file + #[arg(long, default_value_t=String::from("./"))] + source_file_output_directory: String, + /// Directory to output artifacts (instruments and samples) #[arg(long, default_value_t=String::from( "./" ))] artifact_output_directory: String