mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 08:04:16 +00:00
fix bug for #161
This commit is contained in:
@@ -16,6 +16,7 @@ from dotdrop.linktypes import LinkTypes
|
|||||||
from dotdrop.logger import Logger
|
from dotdrop.logger import Logger
|
||||||
from dotdrop.cfg_aggregator import CfgAggregator as Cfg
|
from dotdrop.cfg_aggregator import CfgAggregator as Cfg
|
||||||
from dotdrop.action import Action
|
from dotdrop.action import Action
|
||||||
|
from dotdrop.utils import uniq_list
|
||||||
|
|
||||||
ENV_PROFILE = 'DOTDROP_PROFILE'
|
ENV_PROFILE = 'DOTDROP_PROFILE'
|
||||||
ENV_CONFIG = 'DOTDROP_CONFIG'
|
ENV_CONFIG = 'DOTDROP_CONFIG'
|
||||||
@@ -228,14 +229,18 @@ class Options(AttrMonitor):
|
|||||||
self.compare_dopts = self.args['--dopts']
|
self.compare_dopts = self.args['--dopts']
|
||||||
self.compare_focus = self.args['--file']
|
self.compare_focus = self.args['--file']
|
||||||
self.compare_ignore = self.args['--ignore']
|
self.compare_ignore = self.args['--ignore']
|
||||||
|
self.compare_ignore.extend(self.cmpignore)
|
||||||
self.compare_ignore.append('*{}'.format(self.install_backup_suffix))
|
self.compare_ignore.append('*{}'.format(self.install_backup_suffix))
|
||||||
|
self.compare_ignore = uniq_list(self.compare_ignore)
|
||||||
# "import" specifics
|
# "import" specifics
|
||||||
self.import_path = self.args['<path>']
|
self.import_path = self.args['<path>']
|
||||||
# "update" specifics
|
# "update" specifics
|
||||||
self.update_path = self.args['<path>']
|
self.update_path = self.args['<path>']
|
||||||
self.update_iskey = self.args['--key']
|
self.update_iskey = self.args['--key']
|
||||||
self.update_ignore = self.args['--ignore']
|
self.update_ignore = self.args['--ignore']
|
||||||
|
self.update_ignore.extend(self.upignore)
|
||||||
self.update_ignore.append('*{}'.format(self.install_backup_suffix))
|
self.update_ignore.append('*{}'.format(self.install_backup_suffix))
|
||||||
|
self.update_ignore = uniq_list(self.update_ignore)
|
||||||
self.update_showpatch = self.args['--show-patch']
|
self.update_showpatch = self.args['--show-patch']
|
||||||
# "detail" specifics
|
# "detail" specifics
|
||||||
self.detail_keys = self.args['<key>']
|
self.detail_keys = self.args['<key>']
|
||||||
|
|||||||
@@ -152,6 +152,47 @@ cd ${ddpath} | ${bin} compare -c ${cfg2} --verbose -C ${tmpd}/vscode
|
|||||||
[ "$?" != "0" ] && exit 1
|
[ "$?" != "0" ] && exit 1
|
||||||
set -e
|
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
|
## CLEANING
|
||||||
rm -rf ${basedir} ${tmpd}
|
rm -rf ${basedir} ${tmpd}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user