mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 23:14:47 +00:00
chmod in files and detail commands
This commit is contained in:
@@ -584,15 +584,17 @@ def cmd_list_files(o):
|
||||
if not Templategen.is_template(src):
|
||||
continue
|
||||
if o.files_grepable:
|
||||
fmt = '{},dst:{},src:{},link:{}'
|
||||
fmt = '{},dst:{},src:{},link:{},chmod:{}'
|
||||
fmt = fmt.format(dotfile.key, dotfile.dst,
|
||||
dotfile.src, dotfile.link.name.lower())
|
||||
dotfile.src, dotfile.link.name.lower(),
|
||||
dotfile.chmod)
|
||||
LOG.raw(fmt)
|
||||
else:
|
||||
LOG.log('{}'.format(dotfile.key), bold=True)
|
||||
LOG.sub('dst: {}'.format(dotfile.dst))
|
||||
LOG.sub('src: {}'.format(dotfile.src))
|
||||
LOG.sub('link: {}'.format(dotfile.link.name.lower()))
|
||||
LOG.sub('chmod: {}'.format(dotfile.chmod))
|
||||
LOG.log('')
|
||||
|
||||
|
||||
@@ -730,8 +732,7 @@ def _detail(dotpath, dotfile):
|
||||
attribs = []
|
||||
attribs.append('dst: \"{}\"'.format(dotfile.dst))
|
||||
attribs.append('link: \"{}\"'.format(dotfile.link.name.lower()))
|
||||
if dotfile.chmod:
|
||||
attribs.append('chmod: \"{}\"'.format(dotfile.chmod))
|
||||
attribs.append('chmod: \"{}\"'.format(dotfile.chmod))
|
||||
LOG.log('{} ({})'.format(entry, ', '.join(attribs)))
|
||||
path = os.path.join(dotpath, os.path.expanduser(dotfile.src))
|
||||
if not os.path.isdir(path):
|
||||
|
||||
@@ -126,12 +126,12 @@ set -e
|
||||
|
||||
# test values have been correctly updated
|
||||
echo "========> test for updated entries"
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_link' | head -1 | grep ',link:link$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink' | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink1' | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children' | head -1 | grep ',link:link_children$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children2' | head -1 | grep ',link:link_children$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children3' | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_link' | head -1 | grep ',link:link,'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink' | head -1 | grep ',link:nolink,'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_nolink1' | head -1 | grep ',link:nolink,'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children' | head -1 | grep ',link:link_children,'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children2' | head -1 | grep ',link:link_children,'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -G | grep '^f_children3' | head -1 | grep ',link:nolink,'
|
||||
|
||||
## CLEANING
|
||||
rm -rf ${tmps} ${tmpd}
|
||||
|
||||
@@ -89,7 +89,7 @@ _EOF
|
||||
cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V --link=link_children ${dt}
|
||||
|
||||
# check is set to link_children
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${dt}`" | grep ',link:link_children$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${dt}`" | grep ',link:link_children,'
|
||||
|
||||
# checks file exists in dotpath
|
||||
[ ! -e ${dotpath}/${dt} ] && echo "dotfile not imported" && exit 1
|
||||
|
||||
@@ -80,7 +80,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -114,7 +114,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -148,7 +148,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -182,7 +182,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=link
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -216,7 +216,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -250,7 +250,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -284,7 +284,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -318,7 +318,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V --link=nolink
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:nolink,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -350,7 +350,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} --link=link -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "f_`basename ${df}`" | head -1 | grep ',link:link,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -411,7 +411,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} --link=link_children -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${df}`" | head -1 | grep ',link:link_children$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${df}`" | head -1 | grep ',link:link_children,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
@@ -451,7 +451,7 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 ${df} -V
|
||||
|
||||
# checks
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${df}`" | head -1 | grep ',link:link_children$'
|
||||
cd ${ddpath} | ${bin} files -c ${cfg} -p p1 -V -G | grep "d_`basename ${df}`" | head -1 | grep ',link:link_children,'
|
||||
|
||||
# try to install
|
||||
rm -rf ${tmpd}/qwert
|
||||
|
||||
Reference in New Issue
Block a user