From 7815adda864d34962e1841356605105d212c71c1 Mon Sep 17 00:00:00 2001 From: Isaac Turner Date: Thu, 7 Dec 2023 13:51:29 +0800 Subject: [PATCH] get the rest of the data --- .../wpi/first/gradlerio/deploy/DeployData.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java b/src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java index 1f40c965..dbc0f6bf 100644 --- a/src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java +++ b/src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java @@ -10,12 +10,12 @@ import java.util.Map; import org.gradle.api.GradleException; -import org.gradle.internal.impldep.software.amazon.ion.IonException; import java.util.HashMap; import java.io.IOException; import java.io.File; import java.lang.Runtime; +import java.time.LocalDateTime; class DeployLogFile { public String deployHost; @@ -52,9 +52,20 @@ class DeployLogFile { inGitRepo = false; } - data.put(deployItems[0], deployHost); + try { + deployHost = Runtime.getRuntime().exec("hostname").getOutputStream().toString().strip(); + data.put(deployItems[0], deployHost); + } catch (IOException e) { + throw new GradleException("Couldn't get hostname", e); + } + + deployUser = System.getProperty("user.name"); data.put(deployItems[1], deployUser); + + deployDate = LocalDateTime.now().toString(); data.put(deployItems[2], deployDate); + + codePath = System.getProperty("user.dir"); data.put(deployItems[3], codePath); if (inGitRepo) {