1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

feat: support alternate environment variable names

The current variable names with dots can not be used in some shells.
This commit is contained in:
Florian Greinacher 2023-03-27 10:53:46 +02:00 committed by Florian Greinacher
parent 524fff45b8
commit 4e879c3cfd

View File

@ -210,11 +210,16 @@ public class SecurityUtils {
}
public static String getenv(String name) {
final String env = System.getProperty(name);
String env = System.getProperty(name);
if (StringUtils.isNotEmpty(env))
return env;
return System.getenv(name);
env = System.getenv(name);
if (StringUtils.isNotEmpty(env))
return env;
final String alternateName = name.replace(".", "_").toUpperCase();
return System.getenv(alternateName);
}
/**