Skip to content

Commit

Permalink
reinstate --overwrite flag
Browse files Browse the repository at this point in the history
  • Loading branch information
carderne committed Jul 14, 2024
1 parent c097cf2 commit 2603675
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ See the full help info:
sigexport --help
```

Disable pagination on HTML, and overwrite anything at the destination:
Disable pagination on HTML:
```bash
sigexport --paginate=0 --overwrite ~/signal-chats
sigexport --paginate=0 ~/signal-chats
```

List available chats and exit:
Expand Down
7 changes: 6 additions & 1 deletion sigexport/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def main(
include_empty: bool = Option(
False, "--include-empty", help="Whether to include empty chats"
),
overwrite: bool = Option(
False,
"--overwrite/--no-overwrite",
help="Overwrite contents of output directory if it exists",
),
verbose: bool = Option(False, "--verbose", "-v"),
use_docker: bool = Option(
True, help="Use Docker container for SQLCipher extraction"
Expand Down Expand Up @@ -179,7 +184,7 @@ def main(
dest = Path(dest).expanduser()
if not dest.is_dir():
dest.mkdir(parents=True, exist_ok=True)
else:
elif not overwrite:
secho(
f"Output folder '{dest}' already exists, didn't do anything!", fg=colors.RED
)
Expand Down

0 comments on commit 2603675

Please sign in to comment.