Skip to content

Commit

Permalink
get the rest of the data
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Dec 7, 2023
1 parent b28d3b5 commit 7815add
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/edu/wpi/first/gradlerio/deploy/DeployData.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7815add

Please sign in to comment.