diff --git a/CMakeLists.txt b/CMakeLists.txt index 1082c3c..68f03f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(caesiumclt) # The version number. set(VERSION_MAJOR 0) set(VERSION_MINOR 15) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) configure_file( "src/config.h.in" @@ -13,7 +13,7 @@ configure_file( include_directories("${PROJECT_BINARY_DIR}") if (WIN32) - include_directories("C:\\libcaesium\\caesium") + include_directories("C:\\libcaesium") else () include_directories("/usr/local/include") endif () diff --git a/README.md b/README.md index b9dff0c..d97c073 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Caesium CommandLineTools -##### caesium-clt - v0.15.0-beta (build 20191223) - Copyright © Matteo Paonessa, 2019. All Rights Reserved. +##### caesium-clt - v0.15.1-beta (build 20200123) - Copyright © Matteo Paonessa, 2020. All Rights Reserved. [![Build Status](https://travis-ci.org/Lymphatus/caesium-clt.svg?branch=master)](https://travis-ci.org/Lymphatus/caesium-clt) ---------- @@ -15,6 +15,7 @@ ###### TESTED PLATFORMS * Mac OS X Catalina (v10.15) * Ubuntu 19.04 +* Windows 10 ---------- @@ -90,13 +91,9 @@ $ caesiumclt -q 0 -RS -o ~/output/ ~/Pictures ---------- -###### TODO -* Code cleaning -* Deeper error handling - ----------- - ###### CHANGELOG +* 0.15.1-beta - Fixed rename bug on Windows + "Compressing..." message +* 0.15.0-beta - Support for libcaesium 0.5.0 * 0.14.0-beta - Added --quiet option * 0.13.1-beta - Bugfix * 0.13.0-beta - Bugfix @@ -107,11 +104,3 @@ $ caesiumclt -q 0 -RS -o ~/output/ ~/Pictures * 0.10.1-beta - All features are available * 0.10.0-beta - Switched to cmake build system and libcaesium * 0.9.1-beta - Initial development stage - ----------- - -###### RESOURCES -* caesium-clt website - [http://saerasoft.com/caesium/clt](http://saerasoft.com/caesium/clt) -* Caesium website - [http://saerasoft.com/caesium](http://saerasoft.com/caesium) -* caesium-clt Git Repository - [https://github.com/Lymphatus/caesium-clt](https://github.com/Lymphatus/caesium-clt) -* Author website - SaeraSoft - [http://saerasoft.com](http://saerasoft.com) diff --git a/src/helper.c b/src/helper.c index 47137f7..af0a173 100644 --- a/src/helper.c +++ b/src/helper.c @@ -299,12 +299,12 @@ int start_compression(cclt_options *options, cs_image_pars *parameters) { overwriting = true; } - print_to_console(stdout, verbose, "(%d/%d) %s -> %s\n", + print_to_console(stdout, verbose, "(%d/%d) %s -> %s\nCompressing...", i + 1, options->files_count, filename, f_exists ? original_output_full_path : output_full_path); - + fflush(stdout); //Prevent compression if running in dry mode if (!options->dry_run) { if (cs_compress(options->input_files[i], output_full_path, parameters, &compression_error_code)) { @@ -321,11 +321,12 @@ int start_compression(cclt_options *options, cs_image_pars *parameters) { goto free_and_go_on_with_next_file; } options->output_total_size += output_file_size; - print_to_console(stdout, verbose, "%s -> %s [%.2f%%]\n", + print_to_console(stdout, verbose, "\r%s -> %s [%.2f%%]\n", human_input_size, human_output_size, ((float) output_file_size - input_file_size) * 100 / input_file_size); } else { + print_to_console(stdout, verbose, "\n"); print_to_console(stderr, verbose, "Compression failed with error %d\n", compression_error_code); options->input_total_size -= get_file_size(options->input_files[i]); } @@ -333,6 +334,9 @@ int start_compression(cclt_options *options, cs_image_pars *parameters) { //Rename if we were overwriting if (overwriting && !options->dry_run) { +#ifdef _WIN32 + remove(original_output_full_path); +#endif rename(output_full_path, original_output_full_path); }