Skip to content

Commit

Permalink
Fix locating jabref in jabrefHost.py
Browse files Browse the repository at this point in the history
shutil.which() returns an str and not a pathlib.Path. Therefore, we need
to check if which() actually returns something and if so, we should
convert it to a pathlib.Path such that JABREF_PATH is always of the same
type.

Also, try locating JabRef in addition to jabref in the user's PATH.
  • Loading branch information
michaellass committed Oct 1, 2020
1 parent 2d92025 commit fcd084d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where no longer a warning was displayed when inserting references into LibreOffice with an invalid "ReferenceParagraphFormat". [#6907](https://github.com/JabRef/jabref/pull/60907).
- We fixed an issue where a selected field was not removed after the first click in the custom entry types dialog [#6934](https://github.com/JabRef/jabref/issues/6934)
- We fixed an issue where a remove icon was shown for standard entry types in the custom entry types dialog [6906](https://github.com/JabRef/jabref/issues/6906)
- We fixed an issue with the python script used by browser plugins that failed to locate JabRef if not installed in its default location.

### Removed

Expand Down
10 changes: 6 additions & 4 deletions buildres/linux/jabrefHost.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
JABREF_PATH = script_dir / "bin/JabRef"
if not JABREF_PATH.exists():
JABREF_PATH = shutil.which("jabref")

if not JABREF_PATH.exists():
logging.error("Could not determine JABREF_PATH")
sys.exit(-1)
if not JABREF_PATH:
JABREF_PATH = shutil.which("JabRef")
if not JABREF_PATH:
logging.error("Could not determine JABREF_PATH")
sys.exit(-1)
JABREF_PATH = Path(JABREF_PATH)

logging_dir = Path.home() / ".mozilla/native-messaging-hosts/"
if not logging_dir.exists():
Expand Down

0 comments on commit fcd084d

Please sign in to comment.