• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 17731013783

15 Sep 2025 11:09AM UTC coverage: 68.631% (-0.06%) from 68.686%
17731013783

push

github

web-flow
#1221: Improve WindowsTerminal integration (#1482)

3400 of 5421 branches covered (62.72%)

Branch coverage included in aggregate %.

8878 of 12469 relevant lines covered (71.2%)

3.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

51.35
cli/src/main/java/com/devonfw/tools/ide/commandlet/InstallCommandlet.java
1
package com.devonfw.tools.ide.commandlet;
2

3
import java.nio.file.Path;
4

5
import com.devonfw.tools.ide.cli.GraalVmHelper;
6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.property.ToolProperty;
8
import com.devonfw.tools.ide.property.VersionProperty;
9
import com.devonfw.tools.ide.tool.IdeasyCommandlet;
10
import com.devonfw.tools.ide.tool.ToolCommandlet;
11
import com.devonfw.tools.ide.version.VersionIdentifier;
12

13
/**
14
 * {@link Commandlet} to install a tool.
15
 *
16
 * @see ToolCommandlet#install()
17
 */
18
public class InstallCommandlet extends Commandlet {
19

20
  /** The tool to install. */
21
  public final ToolProperty tool;
22

23
  /** The optional version to set and install. */
24
  public final VersionProperty version;
25

26
  /**
27
   * The constructor.
28
   *
29
   * @param context the {@link IdeContext}.
30
   */
31
  public InstallCommandlet(IdeContext context) {
32

33
    super(context);
3✔
34
    addKeyword(getName());
4✔
35
    this.tool = add(new ToolProperty("", false, "tool"));
11✔
36
    this.version = add(new VersionProperty("", false, "version"));
11✔
37
  }
1✔
38

39
  @Override
40
  public String getName() {
41

42
    return "install";
2✔
43
  }
44

45
  @Override
46
  public boolean isIdeRootRequired() {
47

48
    return this.tool.getValueCount() > 0;
6!
49
  }
50

51
  @Override
52
  public void run() {
53

54
    if (this.tool.getValueCount() == 0) {
4!
55
      IdeasyCommandlet ideasy = new IdeasyCommandlet(this.context);
×
56
      GraalVmHelper graalVmHelper = GraalVmHelper.get();
×
57
      if (graalVmHelper.isNativeImage()) {
×
58
        this.context.debug("Detected that IDEasy is running as graalvm native image...");
×
59
      } else {
60
        this.context.debug("Detected that IDEasy is running in JVM...");
×
61
      }
62
      Path cwd = graalVmHelper.getCwd();
×
63
      this.context.info("Installing IDEasy from {}", cwd);
×
64
      if (!this.context.isForceMode()) {
×
65
        this.context.askToContinue("Sub-command install without any further arguments will perform the initial installation of IDEasy.\n"
×
66
            + "Since this is typically not to be called manually, you may have forgotten to specify the tool to install as extra argument.\n"
67
            + "The current command will install IDEasy on your computer. Are you sure?");
68
      }
69
      ideasy.installIdeasy(cwd);
×
70
      ideasy.setupWindowsTerminal();
×
71
      return;
×
72
    }
73
    ToolCommandlet commandlet = this.tool.getValue();
5✔
74
    VersionIdentifier versionIdentifier = this.version.getValue();
5✔
75
    if (versionIdentifier != null) {
2✔
76
      commandlet.setVersion(versionIdentifier, false);
4✔
77
    }
78
    commandlet.install(false);
4✔
79
  }
1✔
80

81
  @Override
82
  public ToolCommandlet getToolForCompletion() {
83

84
    return this.tool.getValue();
5✔
85
  }
86
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc