Skip to content

Commit

Permalink
Fix issue with relative path and -w opt
Browse files Browse the repository at this point in the history
  • Loading branch information
roosta committed Feb 12, 2017
1 parent 9b77d8e commit 08a1128
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bakc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ file_backup_long() {
mkdir -p "$destination"
fi
cp -Lrx "${1}" "${destination}/${target_file}~${bakc__file_suffix:?}"
echo "backed up '${1}' to ${destination}/${1}.${bakc__file_suffix:?}"
echo "backed up '${1}' to ${destination}/${target_file}~${bakc__file_suffix:?}"
else
echo "failed to backup: ${1}. Not a valid file" >&2
fi
}

file_backup_short() {
if [[ -f $1 || -d $1 ]]; then
cp -Lri "${1}" "./${1}.bak"
cp -Lri "${1}" "$(basename "${1}").bak"
echo "Created ${1}.bak here ($(pwd))"
else
echo "Not a valid file" >&2
Expand Down

0 comments on commit 08a1128

Please sign in to comment.