mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-10-11 17:14:30 +08:00
Add ability to force updates for outdated asset versions
This commit is contained in:
@@ -89,6 +89,9 @@ pub struct Args {
|
||||
#[arg(long, default_value = "", help = "Asset version for overridden asset hashes.")]
|
||||
pub asset_version: String,
|
||||
|
||||
#[arg(long, default_value_t = false, help = "Force an application update for asset versions not marked as latest")]
|
||||
pub force_updates: bool,
|
||||
|
||||
#[arg(long, default_value = "", help = "Asset hash for windows client.")]
|
||||
pub windows_asset_hash: String,
|
||||
|
||||
|
||||
@@ -100,13 +100,16 @@ impl AssetVersion {
|
||||
}
|
||||
|
||||
fn valid_hashes(asset_version: &str, platform: &str) -> Vec<String> {
|
||||
let args = crate::get_args();
|
||||
let mut out = Vec::new();
|
||||
for entry in ASSET_VERSIONS {
|
||||
if entry.platform != platform {
|
||||
continue;
|
||||
}
|
||||
if entry.version == asset_version && !entry.hash.is_empty() {
|
||||
out.push(entry.stock_hash());
|
||||
if entry.latest || !args.force_updates {
|
||||
out.push(entry.stock_hash());
|
||||
}
|
||||
}
|
||||
if entry.latest {
|
||||
if let Some((ov, oh)) = entry.override_pair() {
|
||||
|
||||
Reference in New Issue
Block a user