Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup temporary files, use prefix "jabref-" #7811

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

antalk2
Copy link
Contributor

@antalk2 antalk2 commented Jun 10, 2021

Problem

  • The two changed locations create temporary files, but do not arrange to clean them up.
  • The tests create sevaral copies of journalList.mv, tends to fill up /tmp

Now:

  • these files and directoriees are removed on normal exit
  • they are prefixed with "jabref-" to
    • (1) let the user know who to complain
      and which program should not run while removing
    • (2) make it easier to remove them after abnormal exit
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
    NA

  • Tests created for changes (if applicable)
    NA

  • [X ] Manually tested changed features in running JabRef (always required)

    • also with gradlew test
  • Screenshots added in PR description (for UI changes)
    NA

  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.
    NA

@@ -305,11 +305,12 @@ public Path toTemporaryFile() throws IOException {

// Take everything after the last '/' as name + extension
String fileNameWithExtension = sourcePath.substring(sourcePath.lastIndexOf('/') + 1);
String fileName = FileUtil.getBaseName(fileNameWithExtension);
String fileName = "jabref-" + FileUtil.getBaseName(fileNameWithExtension);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to think long about this. Since its a temporary file anyway, the filename doesn't matter. Thus, good to go!

@calixtus calixtus merged commit 0191910 into JabRef:main Jun 10, 2021
@antalk2 antalk2 deleted the cleanup-temp-files branch June 10, 2021 21:17
Siedlerchr added a commit to koppor/jabref that referenced this pull request Jun 16, 2021
* upstream/main:
  Added auto-key-generation task to task-progress (JabRef#7797)
  cleanup temporary files, use prefix "jabref-" (JabRef#7811)
  Add easier how-to for checklist (JabRef#7813)
  Fix annotation + package of ACMPortalParserTest (JabRef#7812)
  Implemented a select all button for the library import function (issue JabRef#7786) (JabRef#7808)
  Fix for issue 4682 : Restructuring the side pane structure having additional functionality and merging the remove group menus (JabRef#7714)
@btut btut self-assigned this Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants