Skip to content

Commit

Permalink
Flatpak dump of all environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
hbitteur committed Dec 26, 2024
1 parent fe070e6 commit fb5bb0b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/src/main/java/org/audiveris/omr/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -400,10 +402,12 @@ public static void setLocale (Locale locale)
*/
private static void showEnvironment ()
{
for (String var : new String[] { "FLATPAK_ID", "FLATPAK_REF", "FLATPAK_SANDBOX_DIR",
"XDG_SESSION_TYPE" }) {
logger.info("{} env: {} prop: {}", var, System.getenv(var), System.getProperty(var));
if (constants.showAllEnvironmentVariables.isSet()) {
final Map<String, String> map = System.getenv();
final TreeSet<String> keys = new TreeSet<>(map.keySet());
keys.forEach(k -> logger.info("{} : {}", k, map.get(k)));
}

if (constants.showEnvironment.isSet()) {
logger.info(
"""
Expand Down Expand Up @@ -434,6 +438,10 @@ private static class Constants
true,
"Should we show environment?");

private final Constant.Boolean showAllEnvironmentVariables = new Constant.Boolean(
true,
"Should we show all environment variables?");

private final Constant.String locale = new Constant.String(
"en",
"Locale language to be used in the whole application (en, fr)");
Expand Down

0 comments on commit fb5bb0b

Please sign in to comment.