Skip to content

Commit

Permalink
Create the storage directory if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamVenner committed Jan 31, 2022
1 parent 144779f commit 9338401
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gmsv_workshop"
version = "2.1.0"
version = "2.2.0"
edition = "2021"
authors = ["William Venner <[email protected]>"]
publish = false
Expand All @@ -20,6 +20,6 @@ opt-level = "s"
refresh-bindgen = ["steamworks/refresh-bindgen"]

[dependencies]
gmod = { version = "11.1.1", default-features = false }
gmod = { version = "14.0.2", default-features = false }
steamworks = { path = "./steamworks-rs", features = ["raw-bindings"] }
gmod-lzma = "1.0.1"
2 changes: 2 additions & 0 deletions src/workshop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ pub mod downloads {
None => return Ok(None)
};

std::fs::create_dir_all("garrysmod/cache/srcds")?;

std::fs::write(&cache_path, {
let decompressed = gmod_lzma::decompress(&std::fs::read(compressed)?).map_err(|_| std::io::Error::from(std::io::ErrorKind::InvalidData))?;
if !decompressed.starts_with(b"GMAD") {
Expand Down

0 comments on commit 9338401

Please sign in to comment.