diff --git a/BuildLoader.py b/BuildLoader.py index 214d0634..add985aa 100755 --- a/BuildLoader.py +++ b/BuildLoader.py @@ -1218,7 +1218,6 @@ def main(): os.path.join (sbl_dir, 'BootloaderCorePkg/Platform.dsc'), os.path.join (workspace, 'Report.log') ] - cmds = [] if args.distclean: dirs.extend ([ @@ -1228,10 +1227,6 @@ def main(): files.extend ([ ]) - cmds.extend ([ - 'git clean -xdf BaseTools', - ]) - for dir in dirs: dirpath = os.path.join (workspace, dir) print 'Removing %s' % dirpath @@ -1242,7 +1237,8 @@ def main(): print 'Removing %s' % file os.remove(file) - for cmd in cmds: + if os.path.exists(os.path.join (sbl_dir, '.git')): + cmd = 'git clean -xdf BaseTools' x = subprocess.call(cmd.split(' '), cwd=sbl_dir) if x: raise Exception ('Failed to run clean-up commands !')