1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 12:54:18 +00:00

fix cmpignore for #137

This commit is contained in:
deadc0de6
2019-05-19 19:43:07 +02:00
parent 5cb18932a5
commit 9f94f14b87
2 changed files with 29 additions and 2 deletions

View File

@@ -57,6 +57,9 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests'`
mkdir -p ${tmpd}/{program,config}
touch ${tmpd}/program/a
touch ${tmpd}/config/a
mkdir ${tmpd}/vscode
touch ${tmpd}/vscode/extensions.txt
touch ${tmpd}/vscode/keybindings.json
# create the config file
cfg="${basedir}/config.yaml"
@@ -66,6 +69,7 @@ create_conf ${cfg} # sets token
echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/config
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/vscode
# add files
echo "[+] add files"
@@ -131,6 +135,23 @@ cd ${ddpath} | ${bin} compare -c ${cfg2} --verbose
[ "$?" != "0" ] && exit 1
set -e
# update files
echo touched > ${tmpd}/vscode/extensions.txt
echo touched > ${tmpd}/vscode/keybindings.json
# expect two diffs
set +e
cd ${ddpath} | ${bin} compare -c ${cfg} --verbose -C ${tmpd}/vscode
[ "$?" = "0" ] && exit 1
set -e
# expects no diff
sed '/d_vscode:/a \ \ \ \ cmpignore:\n\ \ \ \ - "*extensions.txt"\n\ \ \ \ - "*keybindings.json"' ${cfg} > ${cfg2}
set +e
cd ${ddpath} | ${bin} compare -c ${cfg2} --verbose -C ${tmpd}/vscode
[ "$?" != "0" ] && exit 1
set -e
## CLEANING
rm -rf ${basedir} ${tmpd}