[meld] maint: Allow email/markdown helper to overwrite files
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] maint: Allow email/markdown helper to overwrite files
- Date: Sat, 23 Aug 2014 04:42:40 +0000 (UTC)
commit 65dd378187a6a3b6b123ae9eff0422aa85805ee5
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Aug 23 14:32:58 2014 +1000
maint: Allow email/markdown helper to overwrite files
maint.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/maint.py b/maint.py
index ca47a99..6c02fae 100755
--- a/maint.py
+++ b/maint.py
@@ -302,11 +302,14 @@ def news():
def write_somewhere(filename, output):
if filename and os.path.exists(filename):
- click.echo('File "%s" already exists' % filename)
- raise click.Abort()
+ overwrite = click.confirm(
+ 'File "%s" already exists. Overwrite?' % filename, abort=True)
+ if not overwrite:
+ raise click.Abort()
if filename:
with open(filename, 'w') as f:
f.write(output)
+ click.echo('Wrote %s' % filename)
else:
click.echo(output)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]