Last active
September 6, 2017 06:30
-
-
Save g104robo/23e244dbab0c1f075dfe66b131644bfd to your computer and use it in GitHub Desktop.
link.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -u | |
DOT_DIRECTORY="${HOME}/dotfiles" | |
DOT_CONFIG_DIRECTORY=".config" | |
echo "link home directory dotfiles" | |
cd ${DOT_DIRECTORY} | |
for f in .??* | |
do | |
#無視したいファイルやディレクトリ | |
[ "$f" = ".git" ] && continue | |
[ "$f" = ".config" ] && continue | |
ln -snfv ${DOT_DIRECTORY}/${f} ${HOME}/${f} | |
done | |
echo "link .config directory dotfiles" | |
cd ${DOT_DIRECTORY}/${DOT_CONFIG_DIRECTORY} | |
for file in `\find . -maxdepth 8 -type f`; do | |
#./の2文字を削除するためにfile:2としている | |
ln -snfv ${DOT_DIRECTORY}/${DOT_CONFIG_DIRECTORY}/${file:2} ${HOME}/${DOT_CONFIG_DIRECTORY}/${file:2} | |
done | |
echo "linked dotfiles complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment