commit
81c7618e68
|
|
@ -11,7 +11,7 @@ case $OSTYPE in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
test -w $HOME/$CONFIG_FILE &&
|
test -w $HOME/$CONFIG_FILE &&
|
||||||
cp $HOME/$CONFIG_FILE $HOME/$CONFIG_FILE.bak &&
|
cp -a $HOME/$CONFIG_FILE $HOME/$CONFIG_FILE.bak &&
|
||||||
echo "Your original $CONFIG_FILE has been backed up to $CONFIG_FILE.bak"
|
echo "Your original $CONFIG_FILE has been backed up to $CONFIG_FILE.bak"
|
||||||
|
|
||||||
cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/$CONFIG_FILE
|
cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/$CONFIG_FILE
|
||||||
|
|
|
||||||
|
|
@ -213,5 +213,5 @@ function buf ()
|
||||||
group 'base'
|
group 'base'
|
||||||
local filename=$1
|
local filename=$1
|
||||||
local filetime=$(date +%Y%m%d_%H%M%S)
|
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
|
assert_success
|
||||||
[[ $output == l? ]]
|
[[ $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