Skip to content

Commit

Permalink
fix for issue JabRef#7719, v1
Browse files Browse the repository at this point in the history
  • Loading branch information
devinluo27 committed May 10, 2021
1 parent abd0caa commit 5f11f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,12 @@ public AbstractGroup resultConverter(ButtonType button) {
FieldFactory.parseField(autoGroupPersonsFieldProperty.getValue().trim()));
}
} else if (typeTexProperty.getValue()) {
// issue 7719: add workingDir to filepath if it is relative
Path inputPath = preferencesService.getWorkingDir().resolve(Path.of(texGroupFilePathProperty.getValue().trim()));
resultingGroup = TexGroup.create(
groupName,
groupHierarchySelectedProperty.getValue(),
Path.of(texGroupFilePathProperty.getValue().trim()),
inputPath,
new DefaultAuxParser(new BibDatabase()),
Globals.getFileUpdateMonitor(),
currentDatabase.getMetaData());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private void notifyAboutChange(Path path) {
public void addListenerForFile(Path file, FileUpdateListener listener) throws IOException {
if (isActive()) {
// We can't watch files directly, so monitor their parent directory for updates
// toAbsolutePath() will add the path to Jabref as home directory to file, if file is not a absolute path
Path directory = file.toAbsolutePath().getParent();
directory.register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY);
listeners.put(file, listener);
Expand Down

0 comments on commit 5f11f2d

Please sign in to comment.