From 870ca5f9a09a3e4bdc3d254948bfb399e06cd67a Mon Sep 17 00:00:00 2001 From: Mikhail Gordeev Date: Tue, 31 May 2022 01:26:09 +0300 Subject: [PATCH] Revert all changes to m-p at the end --- cloud_build/cloud_build.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cloud_build/cloud_build.py b/cloud_build/cloud_build.py index 5c44cb3..b484759 100755 --- a/cloud_build/cloud_build.py +++ b/cloud_build/cloud_build.py @@ -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}')