#!/usr/bin/env bash
#
# git does not track file permissions, so this script "fixes" them.
# this should only touch files that are tracked by git.
#
# to have this run automatically, symlink it as a git hook:
#
#     ln -s ~/bin/fix-perms-home ~/.git/hooks/post-checkout
#
# ---
# source: https://github.com/BurntSushi/dotfiles/blob/master/bin/fix-perms-home

# shellcheck shell=bash

restricted_files=("${HOME}/.ssh/config" "${HOME}/.pathrc")

for f in "${restricted_files[@]}"; do
  chmod 0600 "${f}"
done

restricted_dirs=("${HOME}/.config/zsh" "${HOME}/.local/bin")

for f in "${restricted_dirs[@]}"; do
  chmod 0700 "${f}"
done
