Skip to content

Commit

Permalink
Use USER env by default and fallback to 'user.name'
Browse files Browse the repository at this point in the history
  • Loading branch information
jordeu committed Dec 16, 2021
1 parent a8950e8 commit e11d97d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/seqera/tower/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private void sendInfoMessage() throws IOException {
*/
private void validateParameters() throws IOException {
// Fetch username
validatedUserName = System.getProperty("user.name");
validatedUserName = System.getenv().getOrDefault("USER", System.getProperty("user.name"));
if (validatedUserName == null || validatedUserName.isEmpty() || validatedUserName.isBlank()) {
logger.error("Impossible to detect current Unix username.");
System.exit(1);
Expand Down

0 comments on commit e11d97d

Please sign in to comment.