From b48e85b82347f3b8c59a7a3e276c6e5d0c810f10 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Sat, 28 Mar 2026 16:45:21 -0500 Subject: Add debug logging to game symlink creation Log each game's prefix path, detected username, and whether the Documents/My Games directory exists. Also log when scan_and_link_all skips a game due to missing directories. This will help diagnose why some games are not getting their Documents folders symlinked during prefix setup. Co-Authored-By: Claude Opus 4.6 (1M context) --- libs/nak/src/installers/symlinks.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libs') diff --git a/libs/nak/src/installers/symlinks.rs b/libs/nak/src/installers/symlinks.rs index aa55752..e8e477b 100644 --- a/libs/nak/src/installers/symlinks.rs +++ b/libs/nak/src/installers/symlinks.rs @@ -54,6 +54,10 @@ pub fn create_game_symlinks(nak_prefix: &Path, games: &[Game]) { for game in games { // Skip games without prefixes let Some(game_prefix) = &game.prefix_path else { + log_info(&format!( + "Symlink skip '{}' (app_id {}): no prefix_path", + game.name, game.app_id + )); continue; }; @@ -62,6 +66,12 @@ pub fn create_game_symlinks(nak_prefix: &Path, games: &[Game]) { let game_username = find_prefix_username(&game_users_dir); let game_user_dir = game_users_dir.join(&game_username); + let my_games_dir = game_user_dir.join("Documents/My Games"); + log_info(&format!( + "Symlink checking '{}' (app_id {}): prefix={}, user='{}', my_games_exists={}", + game.name, game.app_id, game_prefix.display(), game_username, my_games_dir.is_dir() + )); + // Scan and symlink ALL folders in the game prefix's Documents/My Games/ linked_count += scan_and_link_all( &my_games, @@ -214,10 +224,18 @@ fn scan_and_link_all( _game_prefix: &Path, ) -> usize { if !game_base.is_dir() { + log_info(&format!( + " scan_and_link_all: {} not a dir for '{}', skipping", + game_base.display(), game_name + )); return 0; } let Ok(entries) = fs::read_dir(game_base) else { + log_info(&format!( + " scan_and_link_all: cannot read {} for '{}'", + game_base.display(), game_name + )); return 0; }; -- cgit v1.3.1