Skip to content

Commit

Permalink
fix(files): ensuring file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed Oct 18, 2022
1 parent 01c7b56 commit 11c1ee8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ backup() {
.dir_colors
.exports
.functions
.gemrc
.gitattributes
.gitconfig
.gitignore
.gitmessage
.inputrc
.nanorc
.npmrc
.path
.profile
Expand All @@ -66,12 +68,14 @@ backup() {
.yarnrc
.zshenv
.zshrc
.zprofile
cacert.pem
"

for file in ${FILES}; do
# shellcheck disable=SC2292
if [ -e "${HOME}/${file}" ]; then
if [ -f "${HOME}/${file}" ]; then
# shellcheck disable=SC2154
echo "${GREEN}${NC} Backing up '${YELLOW}${file}${NC}'"
cp -f "${HOME}"/"${file}" "${DF_BACKUPDIR}"/"${file}"
fi
Expand Down

0 comments on commit 11c1ee8

Please sign in to comment.