Skip to content

Commit

Permalink
Create fetch ab out_dir if it doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Duosion committed Nov 9, 2024
1 parent 90ecd84 commit 6c93e7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
asset_name: twintail-linux
- os: windows-latest
artifact_name: twintail.exe
asset_name: twintail-windows-x64.exe
asset_name: twintail-windows.exe

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion 4.0.5.20.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use subcommands::{

#[derive(Debug, Subcommand)]
enum Commands {
/// Fetches game assetbundle files from the game's official servers
/// Commands that fetch assets from the game.
Fetch(fetch::FetchArgs),
/// Decrypts the game's assetbundle files
Decrypt(decrypt::DecryptArgs),
Expand Down
7 changes: 4 additions & 3 deletions src/subcommands/fetch/ab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async fn download_bundle(
out_file.write_all(&ab_data).await?;

// increment progress
download_progress.inc(bundle.file_size as u64);
download_progress.inc(bundle.file_size);
Ok(())
}

Expand All @@ -134,7 +134,7 @@ pub async fn fetch_ab(args: AbArgs) -> Result<(), CommandError> {

// create assetbundle spinner
println!(
"{}[1/] {}{}",
"{}[1/2] {}{}",
color::TEXT_VARIANT.render_fg(),
color::TEXT.render_fg(),
strings::command::RETRIEVING_AB_INFO,
Expand Down Expand Up @@ -168,6 +168,7 @@ pub async fn fetch_ab(args: AbArgs) -> Result<(), CommandError> {

// convert out_dir to a path.
let out_dir = Path::new(&args.out_dir);
create_dir_all(out_dir).await?;

// calculate out paths
let mut total_bundle_size = 0;
Expand Down Expand Up @@ -216,7 +217,7 @@ pub async fn fetch_ab(args: AbArgs) -> Result<(), CommandError> {

// create download progress bar
println!(
"{}[2/] {}{}",
"{}[2/2] {}{}",
color::TEXT_VARIANT.render_fg(),
color::TEXT.render_fg(),
strings::command::DOWNLOADING,
Expand Down

0 comments on commit 6c93e7a

Please sign in to comment.