Skip to content

Commit

Permalink
#358: Fix capitalization for SteamAppId env var lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Sep 30, 2024
1 parent 8b186de commit b2a3b5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* When Steam was not installed, the logs would contain a `warning`-level message.
This has been demoted to an `info`-level message.
* GUI: Fixed some inconsistent spacing between elements.
* CLI: On Linux, the `wrap` command's `--infer steam` option would fail
to find the `SteamAppId` environment variable due to a case mismatch.
* Changed:
* GUI: Updated to the latest version of [Iced](https://github.com/iced-rs/iced).
If the GUI fails to load, Ludusavi will log the error info.
Expand Down
8 changes: 5 additions & 3 deletions src/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ pub struct WrapGameInfo {

impl WrapGameInfo {
fn is_empty(&self) -> bool {
self.name.is_none() && self.gog_id.is_none()
let Self { name, steam_id, gog_id } = self;

name.is_none() && steam_id.is_none() && gog_id.is_none()
}
}

pub fn infer_game_from_steam() -> Option<WrapGameInfo> {
let app_id = std::env::var("STEAMAPPID").ok()?.parse::<u32>().ok()?;
let app_id = std::env::var("SteamAppId").ok()?.parse::<u32>().ok()?;

log::debug!("Found Steam environment variable: STEAMAPPID={}", app_id);
log::debug!("Found Steam environment variable: SteamAppId={}", app_id);

let result = WrapGameInfo {
steam_id: Some(app_id),
Expand Down

0 comments on commit b2a3b5e

Please sign in to comment.