mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 12:46:44 +00:00
linting
This commit is contained in:
@@ -622,6 +622,7 @@ def cmd_detail(opts):
|
||||
|
||||
|
||||
def cmd_uninstall(opts):
|
||||
"""uninstall"""
|
||||
dotfiles = opts.dotfiles
|
||||
keys = opts.uninstall_key
|
||||
|
||||
@@ -649,15 +650,16 @@ def cmd_uninstall(opts):
|
||||
debug=opts.debug,
|
||||
backup_suffix=opts.install_backup_suffix)
|
||||
uninstalled = 0
|
||||
for df in dotfiles:
|
||||
res, msg = uninst.uninstall(df.src,
|
||||
df.dst,
|
||||
df.link)
|
||||
for dotf in dotfiles:
|
||||
res, msg = uninst.uninstall(dotf.src,
|
||||
dotf.dst,
|
||||
dotf.link)
|
||||
if not res:
|
||||
LOG.err(msg)
|
||||
continue
|
||||
uninstalled += 1
|
||||
LOG.log(f'\n{uninstalled} dotfile(s) uninstalled.')
|
||||
return True
|
||||
|
||||
|
||||
def cmd_remove(opts):
|
||||
|
||||
@@ -107,7 +107,6 @@ class Uninstaller:
|
||||
|
||||
def _remove(self, path):
|
||||
"""remove path"""
|
||||
# TODO handle symlink
|
||||
self.log.dbg(f'handling uninstall of {path}')
|
||||
if path.endswith(self.backup_suffix):
|
||||
self.log.dbg(f'skip {path} ignored')
|
||||
@@ -116,8 +115,7 @@ class Uninstaller:
|
||||
if os.path.exists(backup):
|
||||
self.log.dbg(f'backup exists for {path}: {backup}')
|
||||
return self._replace(path, backup)
|
||||
else:
|
||||
self.log.dbg(f'no backup file for {path}')
|
||||
self.log.dbg(f'no backup file for {path}')
|
||||
|
||||
if os.path.isdir(path):
|
||||
self.log.dbg(f'{path} is a directory')
|
||||
|
||||
10
scripts/check-syntax.sh
vendored
10
scripts/check-syntax.sh
vendored
@@ -38,10 +38,12 @@ pyflakes --version
|
||||
# checking for TODO/FIXME
|
||||
echo "--------------------------------------"
|
||||
echo "checking for TODO/FIXME"
|
||||
grep -rv 'TODO\|FIXME' dotdrop/ >/dev/null 2>&1
|
||||
grep -rv 'TODO\|FIXME' tests/ >/dev/null 2>&1
|
||||
grep -rv 'TODO\|FIXME' tests-ng/ >/dev/null 2>&1
|
||||
grep -rv 'TODO\|FIXME' scripts/ >/dev/null 2>&1
|
||||
set +e
|
||||
grep -r 'TODO\|FIXME' dotdrop/ && exit 1
|
||||
grep -r 'TODO\|FIXME' tests/ && exit 1
|
||||
grep -r 'TODO\|FIXME' tests-ng/ && exit 1
|
||||
#grep -r 'TODO\|FIXME' scripts/ && exit 1
|
||||
set -e
|
||||
|
||||
# checking for tests options
|
||||
echo "---------------------------------"
|
||||
|
||||
1
tests-ng/uninstall.sh
vendored
1
tests-ng/uninstall.sh
vendored
@@ -27,6 +27,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sg
|
||||
################################################################
|
||||
export DOTDROP_TEST_NG_UNINSTALL_DDPATH="${ddpath}"
|
||||
export DOTDROP_TEST_NG_UNINSTALL_BIN="${bin}"
|
||||
# shellcheck source=uninstall_
|
||||
source "${cur}"/uninstall_
|
||||
|
||||
export DOTDROP_TEST_NG_UNINSTALL_LINK_TYPE="nolink"
|
||||
|
||||
Reference in New Issue
Block a user