add --dont-fetch

This commit is contained in:
Robin Appelman 2025-06-21 00:07:46 +02:00
commit 35a1f5085c
2 changed files with 20 additions and 9 deletions

View file

@ -15,6 +15,9 @@ depots.
You can find depot id's for an app on You can find depot id's for an app on
[steamdb](https://steamdb.info/app/232250/depots/). [steamdb](https://steamdb.info/app/232250/depots/).
If you only care about knowing the latest manifest, you can pass `--dont-fetch`
to disable pre-fetching the manifest's data.
## Output ## Output
```json ```json

View file

@ -18,6 +18,8 @@ struct Args {
/// Only prefetch the listed depot(s) /// Only prefetch the listed depot(s)
#[clap(long)] #[clap(long)]
depot: Vec<u32>, depot: Vec<u32>,
#[clap(long)]
dont_fetch: bool,
} }
#[tokio::main] #[tokio::main]
@ -37,6 +39,10 @@ async fn main() -> MainResult {
manifest: manifest.gid, manifest: manifest.gid,
}); });
if args.dont_fetch {
let inputs = manifests.collect::<Vec<_>>();
serde_json::to_writer_pretty(std::io::stdout(), &inputs)?;
} else {
let outputs = manifests.map(|input| { let outputs = manifests.map(|input| {
prefetch(&input).map(|hash| ManifestOutput { prefetch(&input).map(|hash| ManifestOutput {
app_id: input.app_id, app_id: input.app_id,
@ -47,10 +53,12 @@ async fn main() -> MainResult {
}).collect::<Result<Vec<_>, _>>()?; }).collect::<Result<Vec<_>, _>>()?;
serde_json::to_writer_pretty(std::io::stdout(), &outputs)?; serde_json::to_writer_pretty(std::io::stdout(), &outputs)?;
}
Ok(()) Ok(())
} }
#[derive(Debug, Serialize)]
struct ManifestInput { struct ManifestInput {
app_id: u32, app_id: u32,
depot_id: u32, depot_id: u32,