Skip to content

Commit

Permalink
fix name of force environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbreckenridge committed Sep 14, 2023
1 parent 8d09f07 commit 6755627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions browserexport/browsers/opera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional
from .common import (
BrowserexportError,
logger,
Paths,
handle_path,
windows_appdata_paths,
Expand Down Expand Up @@ -48,6 +49,7 @@ def locate_database(cls, profile: str = "*") -> Path:
try:
return handle_glob(dd, profile + pth)
except BrowserexportError as e:
logger.debug(e, exc_info=True)
if err is None:
err = e

Expand Down
4 changes: 2 additions & 2 deletions browserexport/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def _sqlite_backup(src: PathIsh, dest: Optional[Path]) -> Optional[sqlite3.Conne


def _print_sqlite_db_to_stdout(pth: Path) -> None:
force = "BROWEREXPORT_FORCE" in os.environ
force = "BROWSEREXPORT_FORCE" in os.environ
# make sure the user is piping this to something else, otherwise dont print
if click.get_text_stream("stdout").isatty() and not force:
logger.error(
"stdout is a TTY, not printing database to stdout. Pipe to something else (e.g. browserexport save ... > db.sqlite, browserexport save ... | gzip --best > db.sqlite.gz) or set BROWEREXPORT_FORCE=1 to print to stdout"
"stdout is a TTY, not printing database to stdout. Pipe to something else (e.g. browserexport save ... > db.sqlite, browserexport save ... | gzip --best > db.sqlite.gz) or set BROWSEREXPORT_FORCE=1 to print to stdout"
)
return

Expand Down

0 comments on commit 6755627

Please sign in to comment.