Skip to content

Commit

Permalink
Exclude WSA's .nomedia when syncing .ssh from WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Dec 27, 2023
1 parent 4a3d7b6 commit 5edd0ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion home/.chezmoiscripts/run_after_40-sync-wsl-ssh-keys.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ true || source ../.chezmoitemplates/scripts-library
win_home="$(wslvar USERPROFILE)"
win_home="$(wslpath "${win_home}")"

rsync_cmd=(rsync --chmod=F600 --archive --delete --itemize-changes --checksum "${win_home}/.ssh/" "${HOME}/.ssh/")
# The .nomedia file is created automatically by WSA with weird permissions that rsync can't handle
rsync_cmd=(rsync --chmod=F600 --archive --delete --itemize-changes --checksum --exclude .nomedia "${win_home}/.ssh/" "${HOME}/.ssh/")

if [[ -f "${win_home}/.ssh/id_rsa" ]] && "${rsync_cmd[@]}" --dry-run | grep --quiet .; then
log_task "Syncing .ssh folder from Windows to WSL"
Expand Down

0 comments on commit 5edd0ea

Please sign in to comment.