sillsdev / languageforge-lexbox

Lexbox, SIL linguistic data hub
MIT License
7 stars 2 forks source link

FwLite: creating project on Linux fails due to Windows-only path #1005

Closed rmunn closed 3 months ago

rmunn commented 3 months ago

Describe the bug Creating a project in FwLite on Linux fails, looking for the path backend/FwLite/LocalWebApp/C:\ProgramData\SIL\FieldWorks\Projects which obviously won't exist.

To Reproduce Steps to reproduce the behavior:

  1. Be running Linux
  2. Run task local-web-app in backend/FwLite
  3. In JS console, type enableDevMode() to see the Create Project button
  4. Type a name and click Create Project
  5. Look at the server logs for the error:

System.IO.DirectoryNotFoundException: Could not find a part of the path '.../backend/FwLite/LocalWebApp/C:\ProgramData\SIL\FieldWorks\Projects'

Desktop (please complete the following information):

rmunn commented 3 months ago

On Linux, the equivalent of C:\ProgramData is specified by the XDG_DATA_HOME environment variable. The standard on Linux is to use lowercase app names under XDG_DATA_HOME, so the Linux build of FieldWorks stores its projects in ${XDG_DATA_HOME}/fieldworks/Projects, backups in ${XDG_DATA_HOME}/fieldworks/backups, and so on.