찾을 수 있습니다. 내 도트 파일에 this one이 있습니다. 하지만 저자가 왜 dotfiles_old를 만드는 지 이해할 수 없습니다. 대신 점 파일로 이동하십시오.도트 파일을 만들 때 dotfiles_old가 필요한 이유
Q1. 그럴만한 이유가 있습니까? 그렇다면 왜?
2. dofiles_old없이 할 수 있습니까? 좋은 생각인가?
미리 감사드립니다. 당신이 당신의 새로운 공상 프롬프트 ~/dotfiles/bashrc
를 업데이트하는 것을 잊었다는 것을 발견하는 경우 ~/dotfiles_old
와
#!/bin/bash
############################
# .make.sh
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory
files="bashrc vimrc vim zshrc oh-my-zsh" # list of files/folders to symlink in homedir
##########
# create dotfiles_old in homedir
echo "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddir
echo "...done"
# change to the dotfiles directory
echo "Changing to the $dir directory"
cd $dir
echo "...done"
# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
for file in $files; do
echo "Moving any existing dotfiles from ~ to $olddir"
mv ~/.$file ~/dotfiles_old/
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
done