1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 00:19:15 +00:00

fix import and debug for travis

This commit is contained in:
deadc0de6
2019-06-24 22:28:09 -04:00
parent a13a96b68b
commit 01597c9c24
4 changed files with 19 additions and 16 deletions

View File

@@ -12,3 +12,7 @@ script:
./tests.sh ./tests.sh
after_success: after_success:
coveralls coveralls
env:
global:
- DOTDROP_FORCE_NODEBUG=
- DOTDROP_NOBANNER=

View File

@@ -354,16 +354,18 @@ def cmd_importer(o):
# prepare hierarchy for dotfile # prepare hierarchy for dotfile
srcf = os.path.join(o.dotpath, src) srcf = os.path.join(o.dotpath, src)
overwrite = not os.path.exists(srcf) overwrite = not os.path.exists(srcf)
if o.safe and os.path.exists(srcf): if os.path.exists(srcf):
c = Comparator(debug=o.debug) overwrite = True
diff = c.compare(srcf, dst) if o.safe:
if diff != '': c = Comparator(debug=o.debug)
# files are different, dunno what to do diff = c.compare(srcf, dst)
LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf)) if diff != '':
LOG.emph(diff) # files are different, dunno what to do
# ask user LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf))
msg = 'Dotfile \"{}\" already exists, overwrite?'.format(srcf) LOG.emph(diff)
overwrite = LOG.ask(msg) # ask user
msg = 'Dotfile \"{}\" already exists, overwrite?'
overwrite = LOG.ask(msg.format(srcf))
if o.debug: if o.debug:
LOG.dbg('will overwrite: {}'.format(overwrite)) LOG.dbg('will overwrite: {}'.format(overwrite))

View File

@@ -73,14 +73,15 @@ _EOF
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir
# change the file # change the file
echo "second" > ${tmpd}/adir/file1 echo "second" >> ${tmpd}/adir/file1
# import file # import file
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir/file1 cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir/file1
# test # test
#cat ${tmps}/dotfiles/${tmpd}/adir/file1
[ ! -e ${tmps}/dotfiles/${tmpd}/adir/file1 ] && echo "not exist" && exit 1 [ ! -e ${tmps}/dotfiles/${tmpd}/adir/file1 ] && echo "not exist" && exit 1
grep 'second' ${tmps}/dotfiles/${tmpd}/adir/file1 grep 'second' ${tmps}/dotfiles/${tmpd}/adir/file1 >/dev/null
## CLEANING ## CLEANING
rm -rf ${tmps} ${tmpd} rm -rf ${tmps} ${tmpd}

View File

@@ -25,10 +25,6 @@ which ${nosebin} 2>/dev/null
[ "$?" != "0" ] && echo "Install nosetests" && exit 1 [ "$?" != "0" ] && echo "Install nosetests" && exit 1
set -e set -e
# comment this to get debug info
#export DOTDROP_FORCE_NODEBUG=
#export DOTDROP_NOBANNER=
# execute tests with coverage # execute tests with coverage
PYTHONPATH=dotdrop ${nosebin} -s --with-coverage --cover-package=dotdrop PYTHONPATH=dotdrop ${nosebin} -s --with-coverage --cover-package=dotdrop
#PYTHONPATH=dotdrop python3 -m pytest tests #PYTHONPATH=dotdrop python3 -m pytest tests