mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 17:24:46 +00:00
fix import and debug for travis
This commit is contained in:
@@ -12,3 +12,7 @@ script:
|
||||
./tests.sh
|
||||
after_success:
|
||||
coveralls
|
||||
env:
|
||||
global:
|
||||
- DOTDROP_FORCE_NODEBUG=
|
||||
- DOTDROP_NOBANNER=
|
||||
|
||||
@@ -354,16 +354,18 @@ def cmd_importer(o):
|
||||
# prepare hierarchy for dotfile
|
||||
srcf = os.path.join(o.dotpath, src)
|
||||
overwrite = not os.path.exists(srcf)
|
||||
if o.safe and os.path.exists(srcf):
|
||||
c = Comparator(debug=o.debug)
|
||||
diff = c.compare(srcf, dst)
|
||||
if diff != '':
|
||||
# files are different, dunno what to do
|
||||
LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf))
|
||||
LOG.emph(diff)
|
||||
# ask user
|
||||
msg = 'Dotfile \"{}\" already exists, overwrite?'.format(srcf)
|
||||
overwrite = LOG.ask(msg)
|
||||
if os.path.exists(srcf):
|
||||
overwrite = True
|
||||
if o.safe:
|
||||
c = Comparator(debug=o.debug)
|
||||
diff = c.compare(srcf, dst)
|
||||
if diff != '':
|
||||
# files are different, dunno what to do
|
||||
LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf))
|
||||
LOG.emph(diff)
|
||||
# ask user
|
||||
msg = 'Dotfile \"{}\" already exists, overwrite?'
|
||||
overwrite = LOG.ask(msg.format(srcf))
|
||||
|
||||
if o.debug:
|
||||
LOG.dbg('will overwrite: {}'.format(overwrite))
|
||||
|
||||
@@ -73,14 +73,15 @@ _EOF
|
||||
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir
|
||||
|
||||
# change the file
|
||||
echo "second" > ${tmpd}/adir/file1
|
||||
echo "second" >> ${tmpd}/adir/file1
|
||||
|
||||
# import file
|
||||
cd ${ddpath} | ${bin} import -f -c ${cfg} -p p1 -V ${tmpd}/adir/file1
|
||||
|
||||
# test
|
||||
#cat ${tmps}/dotfiles/${tmpd}/adir/file1
|
||||
[ ! -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
|
||||
rm -rf ${tmps} ${tmpd}
|
||||
|
||||
4
tests.sh
4
tests.sh
@@ -25,10 +25,6 @@ which ${nosebin} 2>/dev/null
|
||||
[ "$?" != "0" ] && echo "Install nosetests" && exit 1
|
||||
set -e
|
||||
|
||||
# comment this to get debug info
|
||||
#export DOTDROP_FORCE_NODEBUG=
|
||||
#export DOTDROP_NOBANNER=
|
||||
|
||||
# execute tests with coverage
|
||||
PYTHONPATH=dotdrop ${nosebin} -s --with-coverage --cover-package=dotdrop
|
||||
#PYTHONPATH=dotdrop python3 -m pytest tests
|
||||
|
||||
Reference in New Issue
Block a user