Skip to content

Commit

Permalink
Merge pull request #10 from 5GameMaker/master
Browse files Browse the repository at this point in the history
Fixed on Windows
  • Loading branch information
5GameMaker authored Sep 7, 2024
2 parents 0536ebb + 21806b6 commit fbc106e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
use std::{
fs::{self, File},
io::{Read, Write},
os::unix::fs::MetadataExt,
path::PathBuf,
process::{Command, Stdio},
rc::Rc,
sync::{atomic::AtomicU64, Mutex},
};

#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
#[cfg(windows)]
use std::os::windows::fs::MetadataExt;

use zip::{write::FileOptions, ZipWriter};

use crate::{
Expand Down Expand Up @@ -259,7 +263,16 @@ pub fn upload<'a, L: Logger>(config: &'a Config, log: &'a mut L) {
match file.metadata() {
Ok(x) => {
let mut volume = 0;
let mut size = x.size() as f32;
let mut size = {
#[cfg(unix)]
{
x.size()
}
#[cfg(windows)]
{
x.file_size()
}
} as f32;
while size >= 1024.0 && volume < volumes.len() - 1 {
size /= 1024.0;
volume += 1;
Expand Down

0 comments on commit fbc106e

Please sign in to comment.