Compare commits

..

No commits in common. "main" and "1.3.0" have entirely different histories.
main ... 1.3.0

3 changed files with 4 additions and 28 deletions

View File

@ -6,7 +6,7 @@
<groupId>nl.andrewl</groupId> <groupId>nl.andrewl</groupId>
<artifactId>distribugit</artifactId> <artifactId>distribugit</artifactId>
<version>1.3.1</version> <version>1.3.0</version>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>org.kohsuke</groupId> <groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId> <artifactId>github-api</artifactId>
<version>1.306</version> <version>1.303</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/info.picocli/picocli --> <!-- https://mvnrepository.com/artifact/info.picocli/picocli -->
<dependency> <dependency>

View File

@ -17,16 +17,6 @@ public interface RepositoryAction {
* An action which executes a system command, as handled by * An action which executes a system command, as handled by
* {@link ProcessBuilder}. Note that the working directory of the command * {@link ProcessBuilder}. Note that the working directory of the command
* is set to the directory of the repository. * is set to the directory of the repository.
* <p>
* Commands invoked via this method have access to the following
* environment variables:
* </p>
* <ul>
* <li>DISTRIBUGIT_INVOKE_DIR - The directory in which distribugit
* was invoked.</li>
* <li>DISTRIBUGIT_WORKING_DIR - The working directory of distribugit,
* which contains all repositories.</li>
* </ul>
* @param command The command to run. * @param command The command to run.
* @return The command action. * @return The command action.
*/ */
@ -34,8 +24,6 @@ public interface RepositoryAction {
return git -> { return git -> {
ProcessBuilder pb = new ProcessBuilder(command); ProcessBuilder pb = new ProcessBuilder(command);
pb.directory(git.getRepository().getWorkTree()); pb.directory(git.getRepository().getWorkTree());
pb.environment().put("DISTRIBUGIT_INVOKE_DIR", pb.directory().getParentFile().getParentFile().getAbsolutePath());
pb.environment().put("DISTRIBUGIT_WORKING_DIR", pb.directory().getParentFile().getAbsolutePath());
pb.inheritIO(); pb.inheritIO();
Process p = pb.start(); Process p = pb.start();
int result = p.waitFor(); int result = p.waitFor();

View File

@ -27,22 +27,10 @@ public class DistribuGitCommand implements Callable<Integer> {
) )
public String selectorExpression; public String selectorExpression;
@CommandLine.Option( @CommandLine.Option(names = {"-a", "--action"}, description = "The command to run on each repository.", required = true)
names = {"-a", "--action"},
description = """
The command to run on each repository.
Each command has access to the following environment variables:
- DISTRIBUGIT_INVOKE_DIR - The directory in which distribugit was invoked.
- DISTRIBUGIT_WORKING_DIR - The working directory of distribugit.
""",
required = true
)
public String actionCommand; public String actionCommand;
@CommandLine.Option( @CommandLine.Option(names = {"-fa", "--finalization-action"}, description = "A command to run on each repository after all normal actions.")
names = {"-fa", "--finalization-action"},
description = "A command to run on each repository after all normal actions. Has access to the same environment variables as --action."
)
public String finalizationActionCommand; public String finalizationActionCommand;
@CommandLine.Option(names = {"-t", "--access-token"}, description = "The access token to use to perform operations.") @CommandLine.Option(names = {"-t", "--access-token"}, description = "The access token to use to perform operations.")