Revert all changes to m-p at the end

This commit is contained in:
Mikhail Gordeev 2022-05-31 01:26:09 +03:00
parent 3be7835c34
commit 870ca5f9a0

View File

@ -108,16 +108,11 @@ class CB:
self.lock_file.close()
return
def unlink(path) -> None:
try:
os.unlink(path)
except FileNotFoundError:
pass
for name in self.created_scripts:
unlink(name)
unlink(self.work_dir / f'mkimage-profiles/conf.d/{PROG}.mk')
# check directory exists for test: work dir deleted to early
if (self.work_dir / 'mkimage-profiles' / '.git').exists():
os.chdir(self.work_dir / 'mkimage-profiles')
subprocess.run(['git', 'reset', '--hard'])
subprocess.run(['git', 'clean', '-fdx'])
os.chdir(self._save_cwd)
try:
self.info(f'Finish {PROG}')