dotly icon indicating copy to clipboard operation
dotly copied to clipboard

dotfiles backup fails on "dotly/restorer"

Open pablobernardo opened this issue 2 years ago β€’ 0 comments

"dotly/restorer" fails on dotfiles backup because calls create_dotfiles_dir instead of backup_dotfiles_dir

{β–Έ} ~ bash <(curl -s https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/restorer)
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
~ β”‚ πŸš€ Welcome to the dotly restorer!  β”‚ ~
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Checking if Git is installed
 > Git command exists on this system

 > Curl command exists on this system
πŸ€” Where do you want your dotfiles to be located? (default ~/.dotfiles) :
πŸ€” πŸ—‚ Your DOTFILES_PATH is not empty. Do you want to do a backup first? [Y/n] : Y
/dev/fd/11: lΓ­nea 194: create_dotfiles_dir: orden no encontrada

Current code:

# Backup if currently there are any dotfiles and prepare parent directory
if [[ -d "$DOTFILES_PATH" ]] && ! ${continue:-}; then
  _q "πŸ—‚ Your DOTFILES_PATH is not empty. Do you want to do a backup first? [Y/n]" "PROMPT_REPLY"
  [[ "${PROMPT_REPLY:-Y}" =~ ^[Yy] ]] && create_dotfiles_dir "$DOTFILES_PATH"
fi

Fixed code:

# Backup if currently there are any dotfiles and prepare parent directory
if [[ -d "$DOTFILES_PATH" ]] && ! ${continue:-}; then
  _q "πŸ—‚ Your DOTFILES_PATH is not empty. Do you want to do a backup first? [Y/n]" "PROMPT_REPLY"
  [[ "${PROMPT_REPLY:-Y}" =~ ^[Yy] ]] && backup_dotfiles_dir "$DOTFILES_PATH"
fi

pablobernardo avatar Apr 13 '22 11:04 pablobernardo