From: Ralf Jung Date: Thu, 31 Dec 2015 12:23:37 +0000 (+0100) Subject: only ask once for all overwritten files X-Git-Url: https://git.ralfj.de/auto-debuild.git/commitdiff_plain/ceb61b3112ad94e87f33443e0b15e86dbd2c2031?ds=inline only ask once for all overwritten files --- diff --git a/auto_debuild.py b/auto_debuild.py index 2080109..5de381e 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -383,10 +383,10 @@ if __name__ == "__main__": deleteDebianFolder() files = createDebianFiles(config) # check if a file is overwritten - for file in files: - if os.path.exists(file): - if input("Do you want to overwrite %s (y/N)? " % file).lower() != "y": - sys.exit(1) + overwritten_files = list(filter(lambda file: os.path.exists(file), files)) + if overwritten_files: + if input("Do you want to overwrite {} (y/N)? ".format(', '.join(overwritten_files))).lower() != "y": + sys.exit(1) # run compilation buildDebianPackage(config) # install files