changeset 8138:1446b04e4148

'mx fsckprojects' should only ask on a tty
author Andreas Woess <andreas.woess@jku.at>
date Wed, 06 Mar 2013 23:00:44 +0100
parents ae629e3671a0
children 27817b820c64 d413770c6dd0
files mxtool/mx.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Wed Mar 06 21:59:06 2013 +0100
+++ b/mxtool/mx.py	Wed Mar 06 23:00:44 2013 +0100
@@ -2557,8 +2557,7 @@
                 projectConfigFiles = frozenset(['.classpath', 'nbproject'])
                 indicators = projectConfigFiles.intersection(files)
                 if len(indicators) != 0:
-                    response = raw_input(currentDir + ' looks like a removed project -- delete it? [yn]: ')
-                    if 'y' == response:
+                    if not sys.stdout.isatty() or raw_input(currentDir + ' looks like a removed project -- delete it? [yn]: ') == 'y':
                         shutil.rmtree(currentDir)
                         log('Deleted ' + currentDir)