1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 18:34:48 +00:00

fix bug for #161

This commit is contained in:
deadc0de6
2019-06-16 14:19:14 +02:00
parent 5c6db63aa7
commit fd0e522f8a
2 changed files with 46 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ from dotdrop.linktypes import LinkTypes
from dotdrop.logger import Logger
from dotdrop.cfg_aggregator import CfgAggregator as Cfg
from dotdrop.action import Action
from dotdrop.utils import uniq_list
ENV_PROFILE = 'DOTDROP_PROFILE'
ENV_CONFIG = 'DOTDROP_CONFIG'
@@ -228,14 +229,18 @@ class Options(AttrMonitor):
self.compare_dopts = self.args['--dopts']
self.compare_focus = self.args['--file']
self.compare_ignore = self.args['--ignore']
self.compare_ignore.extend(self.cmpignore)
self.compare_ignore.append('*{}'.format(self.install_backup_suffix))
self.compare_ignore = uniq_list(self.compare_ignore)
# "import" specifics
self.import_path = self.args['<path>']
# "update" specifics
self.update_path = self.args['<path>']
self.update_iskey = self.args['--key']
self.update_ignore = self.args['--ignore']
self.update_ignore.extend(self.upignore)
self.update_ignore.append('*{}'.format(self.install_backup_suffix))
self.update_ignore = uniq_list(self.update_ignore)
self.update_showpatch = self.args['--show-patch']
# "detail" specifics
self.detail_keys = self.args['<key>']

View File

@@ -152,6 +152,47 @@ cd ${ddpath} | ${bin} compare -c ${cfg2} --verbose -C ${tmpd}/vscode
[ "$?" != "0" ] && exit 1
set -e
# clean
rm -rf ${basedir}/dotfiles
mkdir -p ${basedir}/dotfiles
# create dotfiles/dirs
mkdir -p ${tmpd}/{program,config,vscode}
touch ${tmpd}/program/a
touch ${tmpd}/config/a
touch ${tmpd}/vscode/extensions.txt
touch ${tmpd}/vscode/keybindings.json
touch ${tmpd}/vscode/keybindings.json
# create the config file
cfg="${basedir}/config3.yaml"
create_conf ${cfg} # sets token
# import
echo "[+] import"
cd ${ddpath} | ${bin} import -c ${cfg} ${tmpd}/program ${tmpd}/config ${tmpd}/vscode
# create the files to ignore
touch ${tmpd}/program/.DS_Store
touch ${tmpd}/config/.DS_Store
touch ${tmpd}/vscode/.DS_Store
# ensure not imported
found=`find ${basedir}/dotfiles/ -iname '.DS_Store'`
[ "${found}" != "" ] && echo "imported ???" && exit 1
# general ignore
echo "[+] comparing ..."
cd ${ddpath} | ${bin} compare -c ${cfg} --verbose -i '*/.DS_Store'
[ "$?" != "0" ] && exit 1
# general ignore
echo "[+] comparing2 ..."
sed '/^config:$/a\ \ cmpignore:\n\ \ - "*/.DS_Store"' ${cfg} > ${cfg2}
cat ${cfg2}
cd ${ddpath} | ${bin} compare -c ${cfg2} --verbose
[ "$?" != "0" ] && exit 1
## CLEANING
rm -rf ${basedir} ${tmpd}