🌟 Add inline prefix handling in main.rs and update script metadata files

This commit is contained in:
2026-04-13 00:36:19 +08:00
parent c51c2a2773
commit 124492d408
3 changed files with 12 additions and 7 deletions

View File

@@ -66,6 +66,11 @@ fn read_to_string(path_opt: Option<&String>) -> XResult<String> {
Ok(buffer)
}
Some(path) => {
let inline_prefix = "inline:";
if path.starts_with(inline_prefix) {
return Ok(path.chars().skip(inline_prefix.len()).collect::<String>());
}
let path = if let Some(cheat_sheet_name) = try_cheat_sheet(path) {
if cheat_sheet_name.is_empty() {
print_cheat_sheet_meta();
@@ -140,5 +145,5 @@ fn try_cheat_sheet(path: &str) -> Option<String> {
None
}
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260413T003310+08:00.MEYCIQDcX8y+GB4tGpZvp0TG
// TOk6LT/J4cFXYOYG88Q3hx4S9QIhAK2IGN/5paueKYKdqO6ikPji6N4LBf4ssbunCM87XyLS
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260413T003557+08:00.MEYCIQCNWXiO8eSLj0FI/N9e
// 5tJcQ7u1d2oMPO11BpAalYvFoQIhAIm1pcCiGctYL2jeon/WL4ihKEnHv2WdJyE55Nye+m3U

View File

@@ -82,11 +82,11 @@
},
"md.rs": {
"script_name": "md.rs",
"script_length": 4391,
"script_sha256": "ccb11edad093e304ca01e0aca5d496c339f387d4e25dc89c6ffee25e0ea92968",
"script_length": 4585,
"script_sha256": "1e2f9c06d7eceb71f56c8d245815deb144e8ad70662cd0f3701430425a822c28",
"script_full_url": "https://git.hatter.ink/rust-scripts/scriptbase/raw/branch/main/md-rs/src/main.rs",
"publish_time": 1775921621093,
"update_time": 1776011608049
"update_time": 1776011776921
},
"myip.rs": {
"script_name": "myip.rs",

View File

@@ -46,8 +46,8 @@
},
"md-rs": {
"script_name": "md-rs",
"script_length": 4391,
"script_sha256": "ccb11edad093e304ca01e0aca5d496c339f387d4e25dc89c6ffee25e0ea92968"
"script_length": 4585,
"script_sha256": "1e2f9c06d7eceb71f56c8d245815deb144e8ad70662cd0f3701430425a822c28"
},
"myip-rs": {
"script_name": "myip-rs",