Enable CI/CD by adding .onedev-buildspec.yml
| .config | Loading last commit info... | |
| git_filters | ||
| .Xresources | ||
| .bashrc | ||
| .gitattributes | ||
| .gitconfig | ||
| .gitignore | ||
| .profile | ||
| .shell_aliases | ||
| .zshrc | ||
| README.md | ||
| nerdfont-installer.sh | ||
| requirements | ||
| stowme.sh |
README.md
Initialize
To create symlinks in your home directory, use stow:
First cd to this repository, for example by checking it out and then cd-ing into it,
then run stow -t ~ . to actually create all symlinks in your home.
To unstow your symlinks, run stow -D . in the repository's directory.
Stow a specific config
You can cd into the repository and give stow a specific folder, like cd dotfiles/.config && stow nvim.
Also to unstow, use stow -D nvim.
Redact secrets in git
echo "*.json filter=redactUser" >> .gitattributes
# can also be config --global, of course
git config filter.redactUser.clean "<path_to_repo>/git_filters/git-filter-redactUser.sh clean"
git config filter.redactUser.smudge "<path_to_repo>/git_filters/git-filter-redactUser.sh smudge"
Then add the config file, "what to redact" (do not commit in git / add to .gitignore, of course):
#!/bin/bash
declare -A settingsMap
settingsMap["/home/username"]="<file-path>"
settingsMap["/var/lib/some_folder"]="<file-path>"
and finally add the git filter script (committed in my dotfiles):
#!/bin/bash
OS_INFO=$(uname -a)
SCRIPT_DIR="$(dirname "$0")"
source $SCRIPT_DIR/config/cfg-reductLocalPaths.sh # It imports the settingsMap variable
escapeSlashes () {
inputString="$1"
escapedForward="$(echo ${inputString//\\/\\\\\\\\})"
echo "$escapedForward"
}
if [[ "$OS_INFO" == *Darwin* ]]; then
SED_CMD="gsed"
else
SED_CMD="sed"
fi
for key in ${!settingsMap[@]}; do
keyEscaped="$(escapeSlashes "${key}")"
valueEscaped="$(escapeSlashes "${settingsMap[${key}]}")"
if [[ "$1" == "clean" ]]; then
SED_CMD+=" -e \"s|${keyEscaped}|${valueEscaped}|g\""
elif [[ "$1" == "smudge" ]]; then
SED_CMD+=" -e \"s|${valueEscaped}|${keyEscaped}|g\""
else
echo "'smudge' or 'clean' shall be given as the first argument"
exit 1
fi
done
eval $SED_CMD