make buf() to respect file attributes on file backup
parent
c81971d1d8
commit
f420560986
|
|
@ -213,5 +213,5 @@ function buf ()
|
|||
group 'base'
|
||||
local filename=$1
|
||||
local filetime=$(date +%Y%m%d_%H%M%S)
|
||||
cp "${filename}" "${filename}_${filetime}"
|
||||
cp -a "${filename}" "${filename}_${filetime}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,3 +34,11 @@ load ../../plugins/available/base.plugin
|
|||
assert_success
|
||||
[[ $output == l? ]]
|
||||
}
|
||||
|
||||
@test 'plugins base: buf()' {
|
||||
mkdir -p $BASH_IT_ROOT
|
||||
declare -r file="${BASH_IT_ROOT}/file"
|
||||
touch $file
|
||||
run buf $file
|
||||
[[ -e ${file}_$(date +%Y%m%d_%H%M%S) ]]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue