eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.55k stars 2.46k forks source link

fix: do not override user-defined THEIA_CONFIG_DIR #13708

Closed xai closed 2 months ago

xai commented 2 months ago

What it does

The current behavior of Theia is to ignore a user-defined THEIA_CONFIG_DIR environment variable, which is an unexpected regression from a user's point of view.

This patch ensures that a user-defined value has precedence over the BackendApplicationPath/data/user-data location and the default location ~/.theia.

Fixes #13700

Contributed on behalf of STMicroelectronics

How to test

  1. Set the THEIA_CONFIG_DIR environment variable to a non-default value: export THEIA_CONFIG_DIR=~/theia-test-data-dir
  2. Start Theia (e.g., yarn browser start)
  3. Confirm that you see a line similar to the following in stdout, indicating that the value you provided in step 1 is used as configuration directory:
    Configuration directory URI: 'file:///home/xai/theia-test-data-dir'
  4. Confirm that this directory has been created on your filesystem (if it has not already existed before)

    Follow-ups

Review checklist

Reminder for reviewers