Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/devonfw#103-…
Browse files Browse the repository at this point in the history
…implement-version-security-checks

# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java
#	cli/src/test/java/com/devonfw/tools/ide/context/AbstractIdeContextTest.java
  • Loading branch information
MattesMrzik committed Dec 19, 2023
2 parents 81b8586 + 1d60d9c commit 7e2023e
Show file tree
Hide file tree
Showing 54 changed files with 1,269 additions and 1,609 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ jobs:
java-version: '17'
- name: Build project with Maven
run: mvn -B -ntp -Dstyle.color=always install
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ jobs:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dmaven.install.skip=true -Dstyle.color=always -B -ntp deploy
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ image:https://img.shields.io/github/license/devonfw/IDEasy.svg?label=License["Ap
image:https://img.shields.io/maven-central/v/com.devonfw.tools.ide/ide-cli.svg?label=Maven%20Central["Maven Central",link=https://search.maven.org/search?q=g:com.devonfw.tools.ide]
image:https://github.com/devonfw/IDEasy/actions/workflows/build.yml/badge.svg["Build Status",link="https://github.com/devonfw/IDEasy/actions/workflows/build.yml"]
image:https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml/badge.svg["Update URLS Status",link="https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml"]
image:https://coveralls.io/repos/github/devonfw/IDEasy/badge.svg?branch=main["Coverage Status",link="https://coveralls.io/github/devonfw/IDEasy?branch=main"]

toc::[]

Expand Down
33 changes: 33 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/cli/CliArgument.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,37 @@ public static CliArgument of(boolean splitShortOpt, String... args) {
return first;
}

/**
* @param firstArgs the first arguments.
* @param nextArgs the additional arguments to append after {@code args}.
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
*/
public static String[] append(String[] firstArgs, String... nextArgs) {

return join(firstArgs, false, nextArgs);
}

/**
* @param nextArgs the arguments to append after {@code firstArgs}.
* @param firstArgs the first arguments.
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
*/
public static String[] prepend(String[] nextArgs, String... firstArgs) {

return join(nextArgs, false, firstArgs);
}

private static String[] join(String[] args, boolean prefix, String... extraArgs) {

String[] result = new String[args.length + extraArgs.length];
int argsStart = 0;
int extraArgsStart = args.length;
if (prefix) {
argsStart = extraArgs.length;
extraArgsStart = 0;
}
System.arraycopy(args, 0, result, argsStart, args.length);
System.arraycopy(extraArgs, 0, result, extraArgsStart, extraArgs.length);
return result;
}
}
2 changes: 1 addition & 1 deletion cli/src/main/java/com/devonfw/tools/ide/cli/Ide.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int run(String... args) {
} catch (CliException error) {
exitStatus = error.getExitCode();
if (context().level(IdeLogLevel.DEBUG).isEnabled()) {
context().error(error.getMessage(), error);
context().error(error, error.getMessage());
} else {
context().error(error.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
public final class HelpCommandlet extends Commandlet {

protected static final String LOGO = """
static final String LOGO = """
__ ___ ___ ___
╲ ╲ |_ _| ╲| __|__ _ ____ _
> > | || |) | _|/ _` (_-< || |
Expand Down
80 changes: 0 additions & 80 deletions cli/src/main/java/com/devonfw/tools/ide/configurator/Args.java

This file was deleted.

Loading

0 comments on commit 7e2023e

Please sign in to comment.