Repository: Y2Z/monolith
Pull request #438 (2025-03-10 23:08:44)

Bump version number (2.8.3 -> 2.9.0)


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 0346539..cca1f67 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -946,7 +946,7 @@ dependencies = [
 
 [[package]]
 name = "monolith"
-version = "2.8.3"
+version = "2.9.0"
 dependencies = [
  "assert_cmd",
  "atty",
diff --git a/Cargo.toml b/Cargo.toml
index f38a645..50c194e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "monolith"
-version = "2.8.3"
+version = "2.9.0"
 authors = [
     "Sunshine <snshn@tutanota.com>",
     "Mahdi Robatipoor <mahdi.robatipoor@gmail.com>",
diff --git a/src/core.rs b/src/core.rs
index a621689..324cdb9 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -540,7 +540,7 @@ pub fn retrieve_asset(
                 ))
             }
         } else {
-            print_error_message(&format!("{} (not found)", &url), options);
+            print_error_message(&format!("{} (file not found)", &url), options);
 
             // Provoke error
             Err(client.get("").send().unwrap_err())
@@ -550,7 +550,7 @@ pub fn retrieve_asset(
 
         if cache.is_some() && cache.as_ref().unwrap().contains_key(&cache_key) {
             // URL is in cache, we get and return it
-            print_info_message(&format!("{} (from cache)", &url), options);
+            print_info_message(&format!("{} (from cache)", &cache_key), options);
 
             Ok((
                 cache.as_ref().unwrap().get(&cache_key).unwrap().0.to_vec(),
@@ -591,7 +591,10 @@ pub fn retrieve_asset(
             match client.get(url.as_str()).headers(headers).send() {
                 Ok(response) => {
                     if !options.ignore_errors && response.status() != reqwest::StatusCode::OK {
-                        print_error_message(&format!("{} ({})", &url, response.status()), options);
+                        print_error_message(
+                            &format!("{} ({})", &cache_key, response.status()),
+                            options,
+                        );
 
                         // Provoke error
                         return Err(client.get("").send().unwrap_err());
@@ -600,9 +603,12 @@ pub fn retrieve_asset(
                     let response_url: Url = response.url().clone();
 
                     if url.as_str() == response_url.as_str() {
-                        print_info_message(&format!("{}", &url), options);
+                        print_info_message(&cache_key.to_string(), options);
                     } else {
-                        print_info_message(&format!("{} -> {}", &url, &response_url), options);
+                        print_info_message(
+                            &format!("{} -> {}", &cache_key, &response_url),
+                            options,
+                        );
                     }
 
                     let new_cache_key: String = clean_url(response_url.clone()).to_string();
@@ -641,7 +647,7 @@ pub fn retrieve_asset(
                     Ok((data, response_url, media_type, charset))
                 }
                 Err(error) => {
-                    print_error_message(&format!("{} ({})", &url, error), options);
+                    print_error_message(&format!("{} ({})", &cache_key, error), options);
 
                     Err(client.get("").send().unwrap_err())
                 }


Test patch:
diff --git a/tests/cli/local_files.rs b/tests/cli/local_files.rs
index a4ff2c4..5d77b85 100644
--- a/tests/cli/local_files.rs
+++ b/tests/cli/local_files.rs
@@ -41,8 +41,8 @@ mod passing {
                 "\
                 {file}{cwd}/tests/_data_/basic/local-file.html\n\
                 {file}{cwd}/tests/_data_/basic/local-style.css\n\
-                {file}{cwd}/tests/_data_/basic/local-style-does-not-exist.css (not found)\n\
-                {file}{cwd}/tests/_data_/basic/monolith.png (not found)\n\
+                {file}{cwd}/tests/_data_/basic/local-style-does-not-exist.css (file not found)\n\
+                {file}{cwd}/tests/_data_/basic/monolith.png (file not found)\n\
                 {file}{cwd}/tests/_data_/basic/local-script.js\n\
                 ",
                 file = file_url_protocol,