mirror of
https://codeberg.org/spire/depot-prefetch.git
synced 2026-06-03 18:14:08 +02:00
add --dont-fetch
This commit is contained in:
parent
f9084b5298
commit
35a1f5085c
2 changed files with 20 additions and 9 deletions
|
|
@ -15,6 +15,9 @@ depots.
|
|||
You can find depot id's for an app on
|
||||
[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
|
||||
|
||||
```json
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ struct Args {
|
|||
/// Only prefetch the listed depot(s)
|
||||
#[clap(long)]
|
||||
depot: Vec<u32>,
|
||||
#[clap(long)]
|
||||
dont_fetch: bool,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
|
|
@ -37,6 +39,10 @@ async fn main() -> MainResult {
|
|||
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| {
|
||||
prefetch(&input).map(|hash| ManifestOutput {
|
||||
app_id: input.app_id,
|
||||
|
|
@ -47,10 +53,12 @@ async fn main() -> MainResult {
|
|||
}).collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
serde_json::to_writer_pretty(std::io::stdout(), &outputs)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct ManifestInput {
|
||||
app_id: u32,
|
||||
depot_id: u32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue