.
This commit is contained in:
parent
650f497a3e
commit
123f276b48
9 changed files with 128 additions and 71 deletions
|
|
@ -5,6 +5,9 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
@NoArgsConstructor(access = AccessLevel.NONE)
|
||||
public class EnvUtils {
|
||||
/**
|
||||
* @throws IllegalStateException if the var is not set
|
||||
*/
|
||||
public static String envOrThrow(String name) {
|
||||
var env = System.getenv(name);
|
||||
if (env == null) throw new IllegalStateException("environment variable " + name + " not set");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue