Skip to content

Commit

Permalink
Disable symlink content paths on Unix as Steamworks doesn't recognise…
Browse files Browse the repository at this point in the history
… them
  • Loading branch information
WilliamVenner committed Sep 19, 2023
1 parent 1d13b9c commit 158ad8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions fastgmad-bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::unnecessary_literal_unwrap)]

use fastgmad::{
bin_prelude::*,
create::{CreateGmaConfig, CreateGmadOut},
Expand Down
1 change: 1 addition & 0 deletions fastgmad-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! `binary` - Recommended if you're using fastgmad in a binary as this enables some binary-related helpers.

#![cfg_attr(not(feature = "binary"), warn(missing_docs))]
#![allow(clippy::unnecessary_literal_unwrap)]

const GMA_MAGIC: &[u8] = b"GMAD";
const GMA_VERSION: u8 = 3;
Expand Down
16 changes: 10 additions & 6 deletions fastgmad-lib/src/workshop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fn workshop_upload(#[cfg(feature = "binary")] noprogress: bool, kind: PublishKin

// Add "Addon" and the addon type to the tags
let tags = {
let mut tags = BTreeSet::from_iter(metadata.tags.into_iter());
let mut tags = BTreeSet::from_iter(metadata.tags);

tags.insert("Addon".to_string());

Expand Down Expand Up @@ -389,7 +389,7 @@ impl ContentPath {

let temp_gma_path = dir.join("fastgmad.gma");

let symlink_result = {
let symlink_result: Result<(), FastGmadError> = {
#[cfg(windows)]
{
let res = std::os::windows::fs::symlink_file(gma_path, &temp_gma_path);
Expand All @@ -401,16 +401,20 @@ impl ContentPath {
}
res
}

/*
Steamworks doesn't recognise symlinks on Unix :<
#[cfg(unix)]
{
std::os::unix::fs::symlink(gma_path, &temp_gma_path)
}
#[cfg(not(any(windows, unix)))]
*/

#[cfg(not(windows))]
{
Err(FastGmadError::IoError(std::io::Error::new(
std::io::ErrorKind::Other,
"Unsupported platform",
)))
Err(fastgmad_io_error!(error: std::io::Error::from(std::io::ErrorKind::Unsupported)))
}
};

Expand Down

0 comments on commit 158ad8a

Please sign in to comment.